Help in java oo

hi,
i wont simple examples how to use class in java
Regards

Hi Ricardo,
I think shoud be interesting in addition to Web Dynpro tutorials, you study a little of core of java language.
This site has a great introduction in Java/OO http://www.javapassion.com/javaintro/
I've seen you are Brazilian, if you prefer the Global Code has free mini courses about java and MC2 give a good introduction http://www.globalcode.com.br/index.jsp?pagina=MiniCursos
Best Regards
Isaías Barroso

Similar Messages

  • XI Mail Adapter: sending emails with attachment with help of java mapping

    Hi ,
    On trying out the scenerio mentioned in the blog, using the java mapping provided
    "XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    The scenerio works just fine.
    But the payload as the content of the attachment is not getting generated in proper XML format.
    I suppose it's because of the replace special characters code part..
    Can anyone help me state the modification required in the code.
    Thanks!
    Regards,
    Faria Mithani

    It might be a codepage issue. Is your original payload UTF-8?

  • Help with java mapping

    PI File adapter has a processing option u2018Empty-Message Handlingu2019 to ignore or Write Empty Files. In case there is no data created after mapping on target side then this option determines whether to write an empty file or not. But there is a catch to this option when it comes to using it with File Content Conversion which is described in SAP Note u2018821267u2019. It states following:
    I configure the receiver channel with File content conversion mode and I set the 'Empty Message Handling' option to ignore. Input payload to the receiver channel is generated out of mapping and it does not have any record sets. However, this payload has a root element. Why does file receiver create empty output file with zero byte size in the target directory?  Example of such a payload generated from mapping is as follows:                                                           
    <?xml version="1.0" encoding="UTF-8"?>                          
    <ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>
    solution :
    If the message payload is empty (i.e., zero bytes in size), then File adapter's empty message handling feature does NOT write files into the target directory. On the other hand, if the payload is a valid XML document (as shown in example) that is generated from mapping with just a root element in it, the File Adapter does not treat it as an empty message and accordingly it writes to the target directory. To achieve your objective of not writing files (that have just a single root element) into the target directory, following could be done:
    Using a Java or ABAP Mapping in order to restrict the creation of node itself during mapping. (This cannot be achieved via Message Mapping)
    Using standard adapter modules to do content conversion first and then write file. 
    can someone help with java mapping that can be used in this case?

    Hi,
        You have not mentioned the version of PI you are working in. In case you are working with PI 7.1 or above then here is the java mapping code you need to add after message mapping in the same interface mapping
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class RemoveRootNode extends AbstractTransformation{
         public void execute(InputStream in, OutputStream out)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         if(docIn.getDocumentElement().hasChildNodes())
              docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
              transform.transform(new DOMSource(docOut), new StreamResult(out));
         else
              out.write(null);
    catch(Exception e)
    public void setParameter(Map arg0) {
    // TODO Auto-generated method stub
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try{
         RemoveRootNode genFormat=new RemoveRootNode();
         FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
         FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
         genFormat.execute(in,out);
         catch(Exception e)
         e.printStackTrace();
    public void transform(TransformationInput arg0, TransformationOutput arg1)
              throws StreamTransformationException {
         // TODO Auto-generated method stub
         this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
    In case you are working in PI 7.0 you can use this code
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class RemoveRootNode implements StreamTransformation{
         public void execute(InputStream in, OutputStream out)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         if(docIn.getDocumentElement().hasChildNodes())
              docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
              transform.transform(new DOMSource(docOut), new StreamResult(out));
         else
              out.write(null);
    catch(Exception e)
    public void setParameter(Map arg0) {
    // TODO Auto-generated method stub
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try{
         RemoveRootNode genFormat=new RemoveRootNode();
         FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
         FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
         genFormat.execute(in,out);
         catch(Exception e)
         e.printStackTrace();
    The code for PI 7.0 should also work for PI 7.1 provided you use the right jar files for compilation, but vice-versa is not true.
    Could you please let us know if this code was useful to you or not?
    Regards
    Anupam
    Edited by: anupamsap on Dec 15, 2011 9:43 AM

  • Call Oracle Help for Java in Oracle forms running in the web

    Hi, everyone,
    We are developing a web-enabled Oracle database application
    system. Oracle suggested us to use Oracle Help for Java(OHJ) to
    create an online help system for the web environment. We
    successfully created a OHJ program which can be independently.
    But we still have no idea how to call this OHJ program from the
    forms running in the web environment.
    Could anyone help us out?
    Thanks.
    null

    I would like to know if anyone has been able to do this too. Could someone respond if they have successfully gotten this to work?
    Thanks!!

  • Need help in Java Script

    i Need some help in Java Script,
    am using the following code :
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    if (window.focus) {newwindow.focus()}
    else {newwindow.close()}
    //     if (window.focus) {newwindow.focus()}
    </script>
    In HTML,
    thWorld Environment
    Day, June 5<sup>th</sup>,2005
    Am using onmouseover event, so that when my mouse in on the link, popup is opened....and when my mouse is out of the link, the new window should b closed....
    but according to the above code, the new window is opened but have to close it manually....
    Is there any other way to close the popup when my mouse is out of the link

    Prawn,
    This is not really a good way to make friends. With the cross posting and the posting in a wrong forum anyway thing you have going.
    Please kindly take your question to an appropriate JavaScript forum.
    Have a happy day.
    Cross post from http://forum.java.sun.com/thread.jspa?messageID=3797201

  • Rename exported file in ODI with help of Java

    Hi.
    We have to implement new scenarios into execution repository. I marked scenarios and I exported them with help of procedure:
    OdiExportScen "-SCEN_NAME=#scen_name" "-SCEN_VERSION=-1" "-FILE_NAME=#DEP_EXPORT_DIRECTORY\SCEN_#SCEN_NAME 001.xml" "-FORCE_OVERWRITE=YES" "-RECURSIVE_EXPORT=YES" "-XML_VERSION=1.0" "-XML_CHARSET=windows-1251" "-JAVA_CHARSET=cp1251"
    But I have to put space between variable #SCEN_NAME and another part of file name. After export I want to rename file with help of Java script, but I get an error when I try to read list of files.
    import java.io.*;
    public class RenameFiles
         public static void main(String[] args)
              String dirPath = new String ("D:\\ODI");
              File dir = new File(dirPath);
              String dirList[] = dir.list(); /* I get error there*/
              for(int i=0; i<dirList.length; i++)
                   File oldFileName = new File(dirPath+"\\"+dirList);
                   File newFileName = new File(dirPath+"\\"+dirList[i].replaceAll(" ","_"));
                   oldFileName.renameTo(newFileName);
    Error in ODI Operator looks like:
    org.apache.bsf.BSFException: BeanShell script error: Parse error at line 9, column 31. Encountered: [ BSF info: Rem at line: 0 column: columnNo
         at bsh.util.BeanShellBSFEngine.eval(Unknown Source)
         at bsh.util.BeanShellBSFEngine.exec(Unknown Source)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.k(e.java)
         at com.sunopsis.dwg.cmd.g.A(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:662)

    I fixed it.
    All I need - put slashes at end of directory name. Also I removed implementation of class.
    import java.io.*;
    String dirPath = new String ("D:\\ODI");
    File dir = new File(dirPath+"\\");                // I put \\ at the end of directory name
    String[] dirList = dir.list();
    for(int i=0; i<dirList.length; i++)
         File oldFileName = new File(dirPath+"\\"+dirList);
         File newFileName = new File(dirPath+"\\"+dirList[i].replaceAll(" ","_"));
         oldFileName.renameTo(newFileName);
    Edited by: user12281180 on Apr 14, 2011 7:44 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Oracle Help for Java 4.2.0 and 4.1.17

    Attention to all: Oracle Help for Java 4.2.0 and 4.1.17 are now available for download at
    http://otn.oracle.com/software/tech/java/help/content.html
    OHJ 4.2.0 features a new Ice Browser and enhancements related to the known modal dialog problem. It requires JDK 1.3 and is a recommended upgrade for all clients using JDK 1.3 or higher.

    4.1.17 appears to work correctly with RoboHelp.
    4.2 gives an error when attempting to generate fts.idx via RoboHelp.

  • Migrating from JavaHelp to Oracle Help for Java

    Currently we have a product in which we have implemented Sun Microsystem's JavaHelp as the Help delivery system. However, after evaluating Oracle Help for Java we would like to migrate from Javahelp to OHJ.
    My question is, how difficult would this migration be from the Development side? I have been reviewing the Oracle Help for Java Developer's Guide and comparing it against the JavaHelp documentation but I haven't been able to get a clear idea of how different the implementation is.
    Thanks,
    Theresa

    Hello Theresa,
    Thanks for considering Oracle Help.
    There isn't much you have to do with your source content and control files. With the exception of the full text search index, the Oracle Help control file formats (helpset, index, map, etc.) extend the JavaHelp formats. So you can use the JavaHelp control files as is, or you can extend them with the Oracle Help extensions. For a quick overview of differences, see the following page in the Oracle Help Guide:
    1. Go to http://otn.oracle.com/ohguide/help/.
    2. Click "Oracle Help File Formats."
    3. Click "Comparision to Javahelp File Formats."
    To create an Oracle Help full text search index, run through the Helpset Authoring Wizard and remove the existing JavaHelp search view and have the wizard generate an Oracle Help Search index
    on the following wizard page. For the Helpset Authoring Wizard doc:
    1. Go to http://otn.oracle.com/ohguide/help/.
    2. Click "Authoring Oracle Help Systems."
    3. Click "Using the HelpSet Authoring Wizard."
    Alternatively, change the helpset file by hand. For the doc:
    1. Go to http://otn.oracle.com/ohguide/help/.
    2. Click "Oracle Help File Formats."
    3. Click "Helpset File."
    Then run the indexer. For doc:
    1. Go to http://otn.oracle.com/ohguide/help/.
    2. Click "Authoring Oracle Help Systems."
    3. Click "Using the Full-text Search Indexer."
    On the development side, the APIs are different, but they are also very
    simple. You create a Help object, add HelpSets, and associate topic-ids
    with java UI components using the CSHManager as described in the
    Oracle Help Guide:
    1. Go to http://otn.oracle.com/ohguide/help/.
    2. Click "Oracle Help for Java Developer's Guide."

  • Help on java math parser

    hi there,
    can anyone pls tell me where i can get some help on 'java programing for math parser'? if the answer is yes then pls tell me where.

    I don't know of a parser that's part of the standard java library, but surely there must be tons of stuff findable with Google. Have you tried to google this?

  • Help on java.sql.Types class

    Hai Friends ,
    I want some help on java.sql.Types class .
    What is the use of the above class ?
    Some details about this class.

    Good Morning Yekesa
    First of all i would like to thank U for looking into my problem.
    I am using java.sql.Types.OTHER for
    {"?=CALL(storedprocedurename.functionname(?))"}
    registerOutParameter(1,javal.sql.Types.OTHER)
    setString(2,"user")
    here the
    second parameter passes an argument to function name ( viz. username say "user")
    and the function will return the ref cursor as follows:
    // declaration in pl/sql procedure
    begin
    rc ref cursor
    open rc for select * from ss_user where login_name="user";
    return rc;
    end
    now the stored procedure has a return value (i.e. stored function) which it needs to register as
    registerOutParameter(1,javal.sql.Types.OTHER)
    and it finally results in the following errors :
    Loading driver
    Before conn stmt
    After conn stmt
    Calling Stored procedure
    Stored procedure called
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:243)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:2487)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:64)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:54)
    at sptest.<init>(sptest.java:28)
    at sptest.main(sptest.java:49)
    T couldn't understand why it is saying Invalid Column Type because its working fine with both
    java.sql.Types.INTEGER
    and
    java.sql.Types.VARCHAR
    Pl help me at the earliest as i have wasted a lot of time on it.
    pl mail me in detail at [email protected]
    bye then
    bansi
    null

  • Urgent  help needed(java frames)

    Hi,
    I need urgent help for correcting a piece of code.
    I have written a piece of code for building a gui with some buttons, drawing some geometric shapes.The code consists of two files called Graph and Frame.
    The problem I suppose in the last part of the Graph file, which Rectangle and Circle are called together, the only shape that the program draws is rectangle.Here is the code:
    //Graph
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    public class Graph extends JPanel {
    LinkedList color;
    LinkedList figures;
    public Graph() {
    setBackground(Color.white);
    figures = new LinkedList();
    color = new LinkedList();
    int z;
    class Point {
    int x;
    int y;
    public Point(int x, int y) {
    this.x = x;
    this.y = y;
    public Point(Point p) {
    x = p.x;
    y = p.y;
    public String toString() {
    return "(" + x + ", " + y + ")";
    public void move(Point dist) {
    x += dist.x;
    y += dist.y;
    abstract class GeomFigur {
    public abstract void move(Point p);
    class Line extends GeomFigur {
    Point p1, p2;
    public Line(Point p1, Point p2) {
    this.p1 = new Point(p1);
    this.p2 = new Point(p2);
    public String toString() { return "Line from " + p1 + " to " + p2;  }
    public void move(Point dist) {
    p1.move(dist);
    p2.move(dist);
    class Rectangle extends Line {
    public Rectangle(Point p1, Point p2) {
    super(p1, p2);
    public String toString() { return "Rectangle from " + p1 + " to " + p2; }
    class Circle extends GeomFigur{
    Point centre;
    int radius;
    public Circle(Point centre, int radius) {
    this.centre = new Point(centre);
    this.radius = radius;
    public String toString() {
    return "Circle, centre " + centre + ", radius " + radius;
    public void move(Point dist) { centre.move(dist); }
    public void addRectangle(int x, int y, Color col) {
    Rectangle r =new Rectangle(new Point(x,y),new Point(x+20,y+20));
    figures.addLast(r);
    color.addLast(col);
    repaint();
    public void addCircle(int x, int y, Color col) {
    Circle c =new Circle(new Point(x,y), 1 );
    figures.addLast(c);
    color.addLast(col);
    repaint();
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    for (int i=0;i < figures.size();i++) {
    Rectangle rect = (Rectangle)figures.get(i);
    //Circle circ = (Circle)figures.get(i);
    g.setColor(Color.black);
    g.drawRect(rect.p1.x,rect.p1.y,20,20);
    g.setColor((Color)color.get(i));
    g.fillRect(rect.p1.x,rect.p1.y,20,20);
    //g.setColor(Color.black);
    // g.drawOval(circ.centre.x,circ.centre.y,20,20);
    // g.setColor((Color)color.get(i));
    // g.fillOval(circ.centre.x, circ.centre.y, 20, 20);
    //Frame
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class Frame extends JFrame implements ActionListener {
    JButton button1, button2, button3, button4, button5 ;
    Graph gr;
    JComboBox cbx;
    JComboBox cby;
    JComboBox col;
    JMenu filemenu;
    JMenuItem quit;
    JMenuBar menubar;
    int x=10;
    int y=10;
    Color color=Color.red;
    public Frame() {
    menubar = new JMenuBar();
    filemenu = new JMenu("File");
    filemenu.setMnemonic('F');
    quit = new JMenuItem("Quit");
    quit.addActionListener(this);
    quit.setMnemonic('Q');
    quit.setAccelerator(KeyStroke.getKeyStroke('Q',Event.CTRL_MASK,false));
    filemenu.add(quit);
    menubar.add(filemenu);
    setJMenuBar(menubar);
    button1 = new JButton("Rectangle");
    button1.addActionListener(this);
    button2 = new JButton("Circle");
    button2.addActionListener(this);
    button4 = new JButton("Ellipse");
    button4.addActionListener(this);
    button5 = new JButton("Triangle");
    button5.addActionListener(this);
    button3 = new JButton("Reset");
    button3.addActionListener(this);
    String[] elements_x= {"10","20","30","40","50","60","70"};
    cbx = new JComboBox(elements_x);
    cbx.addActionListener(this);
    cbx.setActionCommand("cbx");
    String[] elements_y= {"10","20","30","40","50","60","70"};
    cby = new JComboBox(elements_y);
    cby.addActionListener(this);
    cby.setActionCommand("cby");
    String[] elements_color = {"Red","Blue","Green","Orange","Yellow" };
    col = new JComboBox(elements_color);
    col.addActionListener(this);
    col.setActionCommand("col");
    gr = new Graph();
    JPanel top = new JPanel(new BorderLayout());
    JPanel inputs = new JPanel(new GridLayout(6,1));
    inputs.add(button1);
    inputs.add(button2);
    inputs.add(button3);
    inputs.add(button4);
    inputs.add(button5);
    inputs.add(cbx);
    inputs.add(cby);
    inputs.add(col);
    top.add(gr,BorderLayout.CENTER);
    top.add(inputs,BorderLayout.WEST);
    getContentPane().add(BorderLayout.CENTER, top);
    setSize(500,300);//set window size
    //take care of actions
    public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    if (command.equals("Quit")){
    System.exit(0);//terminate program
    else if (command.equals("Rectangle")){
    //add Rectangle to graph at
    //position x,y and with certain color
    gr.addRectangle(x,y,color);
    else if (command.equals("Circle")){
    gr.addCircle(x,y,color);
    else if (command.equals("Reset")){
    else if (command.equals("Triangle")){
    else if (command.equals("Ellipse")){
    else if (command.equals("cbx")){
    x=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("cby")){
    y=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("col")){
    String temp=(String)((JComboBox)e.getSource()).getSelectedItem();
    if (temp=="Red") color=Color.red;
    else if (temp=="Blue") color=Color.blue;
    else if (temp=="Green") color=Color.green;
    else if (temp=="pink") color=Color.pink;
    else if (temp=="lightGray") color=Color.lightGray;
    //main program
    public static void main(String [] args) {
    Frame appl = new Frame();
    appl.setVisible(true);
    Thanks in advance
    Marina

    Hi,
    You are very lucky that I'm currently boored. You should never tag a question as urgent. It might be urgent to you, but not to us who answer. And you should also use code formatting when you post code (see the formatting tips, or use the code-button).
    I made some changes to your Graph class. The most important thing is the abstract draw method that I added to the GeomFigur class.
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Graph extends JPanel {
        LinkedList figures;
        public Graph() {
            setBackground(Color.white);
            figures = new LinkedList();
        int z;
        abstract class GeomFigur {
            protected Color color;
            public GeomFigur(Color color) {
                this.color = color;
            public abstract void move(Point p);
            public abstract void draw(Graphics g);
        abstract class Line extends GeomFigur {
            Point p1, p2;
            public Line(Color c, Point p1, Point p2) {
                super(c);
                this.p1 = new Point(p1);
                this.p2 = new Point(p2);
            public String toString() {
                return "Line from " + p1 + " to " + p2;
            public void move(Point dist) {
                p1.move(dist.x, dist.y);
                p2.move(dist.x, dist.y);
        class Rectangle extends Line {
            public Rectangle(Color c, Point p1, Point p2) {
                super(c, p1, p2);
            public String toString() {
                return "Rectangle from " + p1 + " to " + p2;
            public void draw(Graphics g) {
                System.out.println("Draw rectangle at " + p1 + " with color " + color);
                g.setColor(Color.black);
                g.drawRect(p1.x, p1.y, 20, 20);
                g.setColor(color);
                g.fillRect(p1.x, p1.y, 20, 20);
        class Circle extends GeomFigur {
            Point centre;
            int radius;
            public Circle(Color c, Point centre, int radius) {
                super(c);
                this.centre = new Point(centre);
                this.radius = radius;
            public String toString() {
                return "Circle, centre " + centre + ", radius " + radius;
            public void move(Point dist) {
                centre.move(dist.x, dist.y);
            public void draw(Graphics g) {
                System.out.println("Draw circle at " + centre + " with color " + color);
                g.setColor(Color.black);
                g.drawOval(centre.x, centre.y, 20, 20);
                g.setColor(color);
                g.fillOval(centre.x, centre.y, 20, 20);
        public void addRectangle(int x, int y, Color col) {
            System.out.println("x,y,col " + x + ":" + y + ":" + col);
            Rectangle r = new Rectangle(col, new Point(x, y), new Point(x + 20, y + 20));
            figures.addLast(r);
            repaint();
        public void addCircle(int x, int y, Color col) {
            System.out.println("x,y,col" + x + ":" + y + ":" + col);
            Circle c = new Circle(col, new Point(x, y), 1);
            figures.addLast(c);
            repaint();
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            for (int i = 0; i < figures.size(); i++) {
                GeomFigur drawable = (GeomFigur)figures.get(i);
                drawable.draw(g);
    }/Kaj

  • *URGENT HELP REQUIRED* java.sql.SQLException: Invalid Oracle URL specifed

    Hi all,
    In the middle of the last week for my final year project and having to convert to an Oracle database due to compatibility problems with university Tomcat Server and MS Access. I'm having trouble connecting to the Oracle database and would appreciate some help please.
    Running on Windows 98 in the lab here, and the Oracle 9i, release 9.2.0.2.0, J2SDK1.4.0, Classes12.zip installed OK.
    Code for connection looks like this inside the constructor of my class:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cardSaleConnexion = DriverManager.getConnection("jdbc:oracle:[email protected]:1521:sid","user_name","pwdt");
    System.out.println("Connection Successful ");
    And I'm getting the following error when calling the constructor in a driver program:
    java.sql.SQLException: Invalid Oracle URL specified
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:188)
         at java.sql.DriverManager.getConnection(DriverManager.java:512)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at CardSale.<init>(CardSale.java:30)
         at Driver.main(Driver.java:11)
    Exception in thread "main"
    Please reply on a very urgent basis.
    Kind regards,
    Peter

    Try ojdbc14.jar as the JDBC driver instead of classes12.zip.
    Refer:
    http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
    http://docs.sun.com/source/817-5603-10/index.html
    Database Driver
    This section describes the known database driver issues and associated solutions.
    ID      Summary
    4700531      On Solaris, an ORACLE JDBC driver error occurs.
         This new Java Database Connectivity (JDBC) driver is for Oracle (R) working with JDK1.4. The problem is caused by a combination of the Oracle 9.1 database and ojdbc14.jar. Applying the patch will fix the problem on Solaris 32-bit machine, running an Oracle 9.0.1.3 database.
         Solution
         Obtain and apply the patch to your server from the Oracle Web site for Bug 2199718. Perform the following steps:
         1.��Go to the Oracle web site.
         2.��Click the 'patches' button.
         3.��Type 2199718 in the patch number field.
         4.��Click the 32-bit Solaris OS patch.Go to Metalink.oracle.com.
         5.��Click patches.
         6.��Under patch number, enter 2199718.
         7.��Click the 32 bit Solaris OS patch.
    4707531      On Solaris, accessing an Oracle 9.1 database with an Oracle 9.2 Client may cause data corruption.
         If you use an Oracle (R) 9.2 client to access an Oracle 9.1 database, data corruption might occur when a number column follows a timestamp column.
         The problem might be caused by using the ojdbc14.jar file with an Oracle 9.1 database. Applying the patch might assist in addressing the situation on Solaris 32-bit machines, running an Oracle 9.1 database. This JDBC driver is for Oracle working with JDK1.4.
         Solution
         Obtain the patch that Oracle might make available from the Oracle web site for Bug 2199718 and apply it to your server.
    Regards,
    Pankaj D.

  • Urgent help required "java.lang.Exception: Connection reset"

    Hi Everyone,
    I am getting error message when I access cluster database from grid console.
    Error      java.lang.Exception: Connection reset
    I am unable to create jobs or do other admin stuff on the database, I have searched alot , restarted the repository database, restarted the emgc components, even the agents but of no use. The agent status showing OK as under.
    Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    Agent Version : 10.2.0.3.0
    OMS Version : 10.2.0.3.0
    Protocol Version : 10.2.0.2.0
    Agent Home : /app/oracle/agent/agent10g/rac2.tawaf
    Agent binaries : /app/oracle/agent/agent10g
    Agent Process ID : 19646
    Parent Process ID : 19629
    Agent URL : https://rac2.tawaf:3872/emd/main
    Repository URL : https://tawafapp.tawaf:1159/em/upload
    Started at : 2009-04-02 11:26:10
    Started by user : oracle
    Last Reload : 2009-04-02 11:26:10
    Last successful upload : 2009-04-02 12:27:42
    Total Megabytes of XML files uploaded so far : 3.48
    Number of XML files pending upload : 0
    Size of XML files pending upload(MB) : 0.00
    Available disk space on upload filesystem : 86.22%
    Last successful heartbeat to OMS : 2009-04-02 12:30:20
    Agent is Running and Ready
    The error reported in emoms.log is as under.
    2009-04-02 12:37:25,073 [MetricCollector:RACHOMETAB_THREAD600:60] ERROR rt.RacMetricCollectorTarget _getAllData.184 - oracle.sysman.emSDK.emd.comm.CommException: Connection reset
    oracle.sysman.emSDK.emd.comm.CommException: Connection reset
    at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest(EMDClient.java:1543)
    at oracle.sysman.emSDK.emd.comm.EMDClient.getMetrics(EMDClient.java:915)
    at oracle.sysman.emo.rac.perform.metric.rt.RacHomeTab._getAllData(RacHomeTab.java:180)
    at oracle.sysman.emo.rac.perform.metric.rt.RacHomeTab.getData(RacHomeTab.java:91)
    at oracle.sysman.emo.perf.metric.eng.MetricCached.collectCachedData(MetricCached.java:404)
    at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread._collectCachedData(MetricCollectorThread.java:596)
    at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread.run(MetricCollectorThread.java:320)
    at java.lang.Thread.run(Thread.java:534)
    can anyone help me as its very urgent for me to clear this error.
    thanks

    this error is also reported against the cluster database.
         Thread: SeverityLoad https://rac2.tawaf:3872/emd/main java.sql.SQLException: ORA-20613: Severity for unknown target. (target guid = 1938FC9C72DDAC01E0C0F268FFC5F6AD) ORA-06512: at "SYSMAN.EM_VIOLATION_CHECKS", line 174 ORA-04088: error during execution of trigger 'SYSMAN.EM_VIOLATION_CHECKS' Error occured at line : 43, File name:Severity

  • Help! java wont download and I NEED it!

    Okay so I have tried to download every version of java I can and none of them are working and I need it for my website. I have os x 10.4.8 Tiger so I don't know why it won't work. Can anyone please help me out with this? Thank You.

    Well java should be installed by default as part of Mac OS X. I'm pretty sure both the Java runtime environment AND the software development kit should be included. Maybe be more specific with your question, I might be missing something.

  • Replication of Berkeley DB Xml Edition with the help of JAVA API

    hi,
    i am trying to replicate berkeley DB to 2 other replicas.with the help of small program which along with its documentation(of chapter 3). And i'm using java API for the same(specifically replication framework program.)
    All necessary files are get created at host side like log files, dll files, db files. But at replica(client) side nothing get created. Host and clients are placed in the same network.
    But unfortunately its not working. don't know the reason. And its not giving any sort of error. And i dont know how to go ahead. Or is there any other way should i proceed with.
    So could you help me out to get rid of this problem.
    Thanks

    What compiler are you running?
    See this message and thread:
    Re: Problem after update to 2.3.8
    It may be necessary to apply the -fno-strict-aliasing flag to the Berkeley DB Java library as well.
    Regards,
    George

  • Help with Java script

    So , I edited the ITunes.java as described in the Admin guide.Copied the .class to my cgi folder in the server.I copied the itunesu file from the shell folder of the sample code.I have modified it accordingly.But when I run it in browser(Firefox) as ..../cgi-bin/itunesu it just gives me a blank page.Nothing shows up.I ran the ITunes.java file locally and it generates an HTML output, which I copied and created a new html.After I run this HTML file, it opens my itunes, but again it says page not found and url contains https://www.xxx.edu/cgi-bin/itunesu?destination=xxx.edu where xxx is my institution name.Not sure if I am supposed to display my institution name in forum.
    The admin guide says on page 15 step 4.Copy the itunes.class file and other itunes file to your web server's cgi-bin directory.
    I am not quiet sure what does other itunes file mean??
    This is how my .java file looks.
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.util.*;
    * The <CODE>ITunesU</CODE> class permits the secure transmission
    * of user credentials and identity between an institution's
    * authentication and authorization system and iTunes U.
    * The code in this class can be tested by
    * running it with the following commands:
    * <PRE>
    * javac ITunesU.java
    * java ITunesU</PRE>
    * Changes to values defined in this class' main() method must
    * be made before it will succesfully communicate with iTunes U.
    public class ITunesU extends Object {
    * Generate the HMAC-SHA256 signature of a message string, as defined in
    * RFC 2104.
    * @param message The string to sign.
    * @param key The bytes of the key to sign it with.
    * @return A hexadecimal representation of the signature.
    public String hmacSHA256(String message, byte[] key) {
    // Start by getting an object to generate SHA-256 hashes with.
    MessageDigest sha256 = null;
    try {
    sha256 = MessageDigest.getInstance("SHA-256");
    } catch (NoSuchAlgorithmException e) {
    throw new java.lang.AssertionError(
    this.getClass().getName()
    + ".hmacSHA256(): SHA-256 algorithm not found!");
    // Hash the key if necessary to make it fit in a block (see RFC 2104).
    if (key.length > 64) {
    sha256.update(key);
    key = sha256.digest();
    sha256.reset();
    // Pad the key bytes to a block (see RFC 2104).
    byte block[] = new byte[64];
    for (int i = 0; i < key.length; ++i) block = key;
    for (int i = key.length; i < block.length; ++i) block = 0;
    // Calculate the inner hash, defined in RFC 2104 as
    // SHA-256(KEY ^ IPAD + MESSAGE)), where IPAD is 64 bytes of 0x36.
    for (int i = 0; i < 64; ++i) block ^= 0x36;
    sha256.update(block);
    try {
    sha256.update(message.getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
    throw new java.lang.AssertionError(
    "ITunesU.hmacSH256(): UTF-8 encoding not supported!");
    byte[] hash = sha256.digest();
    sha256.reset();
    // Calculate the outer hash, defined in RFC 2104 as
    // SHA-256(KEY ^ OPAD + INNER_HASH), where OPAD is 64 bytes of 0x5c.
    for (int i = 0; i < 64; ++i) block ^= (0x36 ^ 0x5c);
    sha256.update(block);
    sha256.update(hash);
    hash = sha256.digest();
    // The outer hash is the message signature...
    // convert its bytes to hexadecimals.
    char[] hexadecimals = new char[hash.length * 2];
    for (int i = 0; i < hash.length; ++i) {
    for (int j = 0; j < 2; ++j) {
    int value = (hash >> (4 - 4 * j)) & 0xf;
    char base = (value < 10) ? ('0') : ('a' - 10);
    hexadecimals[i * 2 + j] = (char)(base + value);
    // Return a hexadecimal string representation of the message signature.
    return new String(hexadecimals);
    * Combine user credentials into an appropriately formatted string.
    * @param credentials An array of credential strings. Credential
    * strings may contain any character but ';'
    * (semicolon), '\\' (backslash), and control
    * characters (with ASCII codes 0-31 and 127).
    * @return <CODE>null</CODE> if and only if any of the credential strings
    * are invalid.
    public String getCredentialsString(String[] credentials) {
    // Create a buffer with which to generate the credentials string.
    StringBuffer buffer = new StringBuffer();
    // Verify and add each credential to the buffer.
    if (credentials != null) {
    for (int i = 0; i < credentials.length; ++i) {
    if (i > 0) buffer.append(';');
    for (int j = 0, n = credentials.length(); j < n; ++j) {
    char c = credentials.charAt(j);
    if (c != ';' && c != '\\' && c >= ' ' && c != 127) {
    buffer.append(c);
    } else {
    return null;
    // Return the credentials string.
    return buffer.toString();
    * Combine user identity information into an appropriately formatted string.
    * @param displayName The user's name (optional).
    * @param emailAddress The user's email address (optional).
    * @param username The user's username (optional).
    * @param userIdentifier A unique identifier for the user (optional).
    * @return A non-<CODE>null</CODE> user identity string.
    public String getIdentityString(String displayName, String emailAddress,
    String username, String userIdentifier) {
    // Create a buffer with which to generate the identity string.
    StringBuffer buffer = new StringBuffer();
    // Define the values and delimiters of each of the string's elements.
    String[] values = { displayName, emailAddress,
    username, userIdentifier };
    char[][] delimiters = { { '"', '"' }, { '<'(', ')' }, { '[', ']' } };
    // Add each element to the buffer, escaping
    // and delimiting them appropriately.
    for (int i = 0; i < values.length; ++i) {
    if (values != null) {
    if (buffer.length() > 0) buffer.append(' ');
    buffer.append(delimiters[0]);
    for (int j = 0, n = values.length(); j < n; ++j) {
    char c = values.charAt(j);
    if (c == delimiters[1] || c == '\\') buffer.append('\\');
    buffer.append(c);
    buffer.append(delimiters[1]);
    // Return the generated string.
    return buffer.toString();
    * Generate an iTunes U digital signature for a user's credentials
    * and identity. Signatures are usually sent to iTunes U along
    * with the credentials, identity, and a time stamp to warrant
    * to iTunes U that the credential and identity values are
    * officially sanctioned. For such uses, it will usually makes
    * more sense to use an authorization token obtained from the
    * {@link #getAuthorizationToken(java.lang.String, java.lang.String, java.util.Date, byte[])}
    * method than to use a signature directly: Authorization
    * tokens include the signature but also the credentials, identity,
    * and time stamp, and have those conveniently packaged in
    * a format that is easy to send to iTunes U over HTTPS.
    * @param credentials The user's credentials string, as
    * obtained from getCredentialsString().
    * @param identity The user's identity string, as
    * obtained from getIdentityString().
    * @param time Signature time stamp.
    * @param key The bytes of your institution's iTunes U shared secret key.
    * @return A hexadecimal representation of the signature.
    public String getSignature(String credentials, String identity,
    Date time, byte[] key) {
    // Create a buffer in which to format the data to sign.
    StringBuffer buffer = new StringBuffer();
    // Generate the data to sign.
    try {
    // Start with the appropriately encoded credentials.
    buffer.append("credentials=");
    buffer.append(URLEncoder.encode(credentials, "UTF-8"));
    // Add the appropriately encoded identity information.
    buffer.append("&identity=");
    buffer.append(URLEncoder.encode(identity, "UTF-8"));
    // Add the appropriately formatted time stamp. Note that
    // the time stamp is expressed in seconds, not milliseconds.
    buffer.append("&time=");
    buffer.append(time.getTime() / 1000);
    } catch (UnsupportedEncodingException e) {
    // UTF-8 encoding support is required.
    throw new java.lang.AssertionError(
    "ITunesU.getSignature(): UTF-8 encoding not supported!");
    // Generate and return the signature.
    String signature = this.hmacSHA256(buffer.toString(), key);
    return signature;
    * Generate and sign an authorization token that you can use to securely
    * communicate to iTunes U a user's credentials and identity. The token
    * includes all the data you need to communicate to iTunes U as well as
    * a creation time stamp and a digital signature for the data and time.
    * @param credentials The user's credentials string, as
    * obtained from getCredentialsString().
    * @param identity The user's identity string, as
    * obtained from getIdentityString().
    * @param time Token time stamp. The token will only be valid from
    * its time stamp time and for a short time thereafter
    * (usually 90 seconds).
    * @param key The bytes of your institution's iTunes U shared secret key.
    * @return The authorization token. The returned token will
    * be URL-encoded and can be sent to iTunes U with
    * a form
    * submission. iTunes U will typically respond with
    * HTML that should be sent to the user's browser.
    public String getAuthorizationToken(String credentials, String identity,
    Date time, byte[] key) {
    // Create a buffer with which to generate the authorization token.
    StringBuffer buffer = new StringBuffer();
    // Generate the authorization token.
    try {
    // Start with the appropriately encoded credentials.
    buffer.append("credentials=");
    buffer.append(URLEncoder.encode(credentials, "UTF-8"));
    // Add the appropriately encoded identity information.
    buffer.append("&identity=");
    buffer.append(URLEncoder.encode(identity, "UTF-8"));
    // Add the appropriately formatted time stamp. Note that
    // the time stamp is expressed in seconds, not milliseconds.
    buffer.append("&time=");
    buffer.append(time.getTime() / 1000);
    // Generate and add the token signature.
    String data = buffer.toString();
    buffer.append("&signature=");
    buffer.append(this.hmacSHA256(data, key));
    } catch (UnsupportedEncodingException e) {
    // UTF-8 encoding support is required.
    throw new java.lang.AssertionError(
    "ITunesU.getAuthorizationToken(): "
    + "UTF-8 encoding not supported!");
    // Return the signed authorization token.
    return buffer.toString();
    * Send a request for an action to iTunes U with an authorization token.
    * @param url URL defining how to communicate with iTunes U and
    * identifying which iTunes U action to invoke and which iTunes
    * U page or item to apply the action to. Such URLs have a
    * format like <CODE>[PREFIX]/[ACTION]/[DESTINATION]</CODE>,
    * where <CODE>[PREFIX]</CODE> is a value like
    * "https://deimos.apple.com/WebObjects/Core.woa" which defines
    * how to communicate with iTunes U, <CODE>[ACTION]</CODE>
    * is a value like "Browse" which identifies which iTunes U
    * action to invoke, and <CODE>[DESTINATION]</CODE> is a value
    * like "example.edu" which identifies which iTunes U page
    * or item to apply the action to. The destination string
    * "example.edu" refers to the root page of the iTunes U site
    * identified by the domain "example.edu". Destination strings
    * for other items within that site contain the site domain
    * followed by numbers separated by periods. For example:
    * "example.edu.123.456.0789". You can find these
    * strings in the items' URLs, which you can obtain from
    * iTunes. See the iTunes U documentation for details.
    * @param token Authorization token generated by getAuthorizationToken().
    * @return The iTunes U response, which may be HTML or
    * text depending on the type of action invoked.
    public String invokeAction(String url, String token) {
    // Send a request to iTunes U and record the response.
    StringBuffer response = null;
    try {
    // Verify that the communication will be over SSL.
    if (!url.startsWith("https")) {
    throw new MalformedURLException(
    "ITunesU.invokeAction(): URL \""
    + url + "\" does not use HTTPS.");
    // Create a connection to the requested iTunes U URL.
    HttpURLConnection connection =
    (HttpURLConnection)new URL(url).openConnection();
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    connection.setRequestMethod("POST");
    connection.setRequestProperty(
    "Content-Type",
    "application/x-www-form-urlencoded; charset=UTF-8");
    // Send the authorization token to iTunes U.
    connection.connect();
    OutputStream output = connection.getOutputStream();
    output.write(token.getBytes("UTF-8"));
    output.flush();
    output.close();
    // Read iTunes U's response.
    response = new StringBuffer();
    InputStream input = connection.getInputStream();
    Reader reader = new InputStreamReader(input, "UTF-8");
    reader = new BufferedReader(reader);
    char[] buffer = new char[16 * 1024];
    for (int n = 0; n >= 0;) {
    n = reader.read(buffer, 0, buffer.length);
    if (n > 0) response.append(buffer, 0, n);
    // Clean up.
    input.close();
    connection.disconnect();
    } catch (UnsupportedEncodingException e) {
    // ITunes U requires UTF-8 and ASCII encoding support.
    throw new java.lang.AssertionError(
    "ITunesU.invokeAction(): UTF-8 encoding not supported!");
    } catch (IOException e) {
    // Report communication problems.
    throw new java.lang.AssertionError(
    "ITunesU.invokeAction(): I/O Exception " + e);
    // Return the response received from iTunes U.
    return response.toString();
    * iTunes U credential and identity transmission sample. When your
    * itunes U site is initially created, Apple will send your institution's
    * technical contact a welcome email with a link to an iTunes U page
    * containing the following information, which you will need to customize
    * this method's code for your site:
    <DD><DL><DT>
    * Information:<DD><CODE>
    * Site URL</CODE> - The URL to your site in iTunes U. The last
    * component of that URL, after the last slash,
    * is a domain name that uniquely identifies your
    * site within iTunes U.<DD><CODE>
    * shared secret</CODE> - A secret key known only to you and Apple that
    * allows you to control who has access to your
    * site and what access they have to it.<DD><CODE>
    * debug suffix</CODE> - A suffix you can append to your site URL
    * to obtain debugging information about the
    * transmission of credentials and identity
    * information from your institution's
    * authentication and authorization services
    * to iTunes U.<DD><CODE>
    * administrator credential</CODE> - The credential string to assign
    * to users who should have the
    * permission to administer your
    * iTunes U site.</DL></DD>
    <DD>
    * Once you have substitute the information above in this method's code
    * as indicated in the code's comments, this method will connect
    * to iTunes U and obtain from it the HTML that needs to be returned to a
    * user's web browser to have a particular page or item in your iTunes U
    * site displayed to that user in iTunes. You can modify this method to
    * instead output the URL that would need to be opened to have that page
    * or item displayed in iTunes.</DD>
    public static void main(String argv[]) {
    // Define your site's information. Replace these
    // values with ones appropriate for your site.
    String siteURL =
    "https://deimos.apple.com/WebObjects/Core.woa/Browse/xxx.edu" ;
    String debugSuffix = "/abc123";
    String sharedSecret = "some key";
    String administratorCredential =
    "Administrator@urn:mace:itunesu.com:sites:xxx.edu";
    // Define the user information. Replace the credentials with the
    // credentials you want to grant to the current user, and the
    // optional identity information with the identity of that user.
    // For initial testing and site setup, use the singe administrator
    // credential defined when your iTunes U site was created. Once
    // you have access to your iTunes U site, you will be able to define
    // additional credentials and the iTunes U access they provide.
    String[] credentialsArray = { administratorCredential };
    String displayName = "my name";
    String emailAddress = "my [email protected]";
    String username = "mylogin";
    String userIdentifier = "1243";
    // Define the iTunes U page to browse. Use the domain name that
    // uniquely identifies your site in iTunes U to browse to that site's
    // root page; use a destination string extracted from an iTunes U URL
    // to browse to another iTunes U page; or use a destination string
    // supplied as the "destination" parameter if this program is being
    // invoked as a part of the login web service for your iTunes U site.
    String siteDomain = siteURL.substring(siteURL.lastIndexOf('/') + 1);
    String destination = siteDomain;
    // Append your site's debug suffix to the destination if you want
    // to receive an HTML page providing information about the
    // transmission of credentials and identity between this program
    // and iTunes U. Uncomment the following line for testing only.
    //destination = destination + debugSuffix;
    // Use an ITunesU instance to format the credentials and identity
    // strings and to generate an authorization token for them.
    ITunesU iTunesU = new ITunesU();
    String identity = iTunesU.getIdentityString(displayName, emailAddress,
    username, userIdentifier);
    String credentials = iTunesU.getCredentialsString(credentialsArray);
    Date now = new Date();
    byte[] key = null;
    try {
    key = sharedSecret.getBytes("US-ASCII");
    } catch (UnsupportedEncodingException e) {
    throw new java.lang.AssertionError(
    "ITunesU.hmacSH256(): US-ASCII encoding not supported!");
    String token = iTunesU.getAuthorizationToken(credentials, identity,
    now, key);
    // Use the authorization token to connect to iTunes U and obtain
    // from it the HTML that needs to be returned to a user's web
    // browser to have a particular page or item in your iTunes U
    // site displayed to that user in iTunes. Replace "/Browse/" in
    // the code below with "/API/GetBrowseURL/" if you instead want
    // to return the URL that would need to be opened to have that
    // page or item displayed in iTunes.
    String prefix = siteURL.substring(0, siteURL.indexOf(".woa/") + 4);
    String url = prefix + "/Browse/" + destination;
    String results = iTunesU.invokeAction(url, token);
    System.out.println(results);
    The itunes file from Shell folder has been modified as follows
    DISPLAY_NAME= "myname"
    EMAIL_ADDRESS="[email protected]"
    USERNAME="mylogin"
    USER_IDENTIFIER="1243"
    all the other things in that file have been untouched.
    I also generated the debug which looks like this
    iTunes U Access Debugging
    Received
    Destination xxx.edu
    Identity "my name" <[email protected]> (mylogin) [1243]
    Credentials Administrator@urn:mace:itunesu.com:sites:xxx.edu
    Time 1196706873
    Signature 533870b8jshdidk333lfsf6a3143a55c132ec548a4d545bd79322402e8e2596e4
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is valid and provides the following information:
    Display Name my name
    Email Address [email protected]
    Username mylogin
    User Identifier 1243
    The credential string is valid and contains the following recognized credential:
    1. Administrator@urn:mace:itunesu.com:sites:xxx.edu
    The time string is valid and corresponds to 2007-12-03 18:34:33Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    1. All@urn:mace:itunesu.com:sites:xxx.edu
    2. Authenticated@urn:mace:itunesu.com:sites:xxx.edu
    With these credentials, you have browsing, downloading, uploading, and editing access to the requested destination.
    I am pretty new to this, and working on this for the first time.If someone could guide me through this would be pretty helpful.

    This is only going to work under IE !
    Go to your page template :
    Modify the definition, make sur you have this :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>#TITLE#</title>
    #HEAD#
    <Script language = javascript>
    Browser = navigator.appName
    Net = Browser.indexOf("Netscape")
    Micro = Browser.indexOf("Microsoft")
    Netscape = false
    IE = false
    if(Net >= 0) {Netscape = true}
    if(Micro >= 0) {IE = true}
    function XYpos() {
    if (IE == true) {
    xPos = event.screenX
    yPos = event.screenY
    alert(xPos + " left " + yPos + " down")
    else if (Netscape == true) {alert("Script won't work: " + "\n" + "You're using Netscape")}
    </script>
    Modify the body definition, make sure you have this :
    <body #ONLOAD# onMouseDown = XYpos()>
    I didnt try it but it make sens to me... tell me if it works!
    Flex
    Homepage : http://www.insum.ca
    InSum Solutions' blog : http://insum-apex.blogspot.com

Maybe you are looking for