Editable graphics with java?

hello ,
I have to create a gui where the user can view an image of the local network. think this would work with a jpg, but the problem is that it should be possible to edit the machines to change their names and also to change the network-graphic - means to add new machines and connections between them.
Is this possible with java? which classes can I use and where can I
find a tutorial?
thanks for help!!
lars

Yes it is possible.
If you get the Graphics object from the Image, you can edit however you want. You will need a encoder to save the Image back to whatever format.
Check you this site with good coverage http://www.geocities.com/marcoschmidt.geo/java-image-faq.html

Similar Messages

  • "Create Report" OR ONLY "edit report" with java?

    Dear all
    Is it possible to create a new crystal report with java?
    Do you have some classnames, methodenames, etc that bring me back on the right track?
    I found: "With the latest versions of Crystal, there is no way to actually allow your users to create a report.  There used to be a COM component called "RDC", but that was deprecated with Crystal XI and is no longer available."
    My Version is Crystal Reports 2008 - is this still up to date?
    best regards!
    Edited by: gipsomat on Dec 17, 2010 12:31 PM

    You would want to look for Crystal Reports for Eclipse 2.0 which is the equivalent Java SDK for Crystal Reports 2008.  You can then find samples for Report Modification [here|http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsJava+SDKSamples#CrystalReportsJavaSDKSamples-ReportModification]
    Generally you need to start with loading an rpt file, but this report can be blank.

  • Should we avoid Graphical mapping and stick with Java mapping?

    After developing mappings in XI for a month, I just don't see any good reasons to use Graphical mappings over Java mappings. Maybe some experienced users here can give me some valid reasons why we should choose Graphical mappings. Here is what I think:
    Disadvantages of Graphical mappings:
    1. No way to perform automated unit testings. This is probably the biggest reason I hate it. You can do some tests manually when you work in Integration Builder. But there is no way you can write some unit testing utilities to automate the task.
    2. Complexity. Even for some simple requirements, your Graphical mappings can become complicated and hard to understand. A lot of times, I find myself staring at several dozens of graphical nodes and try to understand what it does.
    3. Impossible to reuse. This is totally against the DRY (Don't repeat yourself) principle. For example, to generate messages for JDBC adapter, it is common to have two identical fields for primary keys: one in the access node and another in the key node. If you change the mapping logic in one, you have to remember to change the other.
    Advantage with Java mappings:
    1. Fully automated unit testing. You can create JUnit tests along with your Java mapping classes and use Maven or other build tools to perform automated unit testing.
    2. Your choice of XML parsing and binding. With Java mapping, you can choose any open source framework for XML parsing and binding. For example, with XMLBeans, I can convert XML input message to a Java object, transform to another Java object and write to output message. And each Java object is generated from its corresponding XML schema.
    3. Highly reusable. We can use fundamental object-oriented designs to create highly reusable mapping components.
    4. Better version control. Since the mappings are just Java classes, we can use CVS or SVN to track code changes.
    5. Better build tools. We can fully utilize build tools like Ant and Maven to automate the build, unit tests, or even generate documents and mapping web sites.
    So do you guys agree? Maybe I am still new to XI or I am missing some important things. But at this point, I just don't see why I should use Graphical mappings. Is there anyone developing XI interfaces completely with Java mappings?
    Thanks in advance for any comments!
    Kenny Cheang

    Hi Suraj,
    > Since its graphical the blocks will take space, but
    > there is always an adavntage of processing time.
    > Ebven though it may appear bigger, it will take less
    > time as compared with Java code (for the same
    > mapping).
    Could you explain more why the graphical mapping has better performance? I thought the graphical mapping is compiled into a Java class in the runtime anyway.
    > Yes thats there, but same goes with Java mapping too
    > right (if you haven't mentioned it as constants)
    I mainly think about inheritance. If I have to build 10 interfaces and they all have some common behavior, I can create a base interface class to encapsulate the common logic. But with graphical mapping, you have to duplicate them in each interface.
    > Disadvantages of Java mapping:
    > 1. Performance
    Same as above. I just don't see why Java has worse performance. I actually think Java should have better performance. You can optimize the code anyway you want. In some cases, you have to use queue functions in graphical mapping but it's not necessary in Java.
    > 2. All might not be well versed with Java Code(though
    > everyone may know basic java) .
    I am not asking everyone to abandon graphical mapping. I am just wondering which one is better when you have skills for both.
    > 3. Lot of standard functions are available in GM
    > which you can choose, but you have to remember the
    > exact code for those in Java mapping.
    You can create functions in Java too. All you have to do is to remember the function name.
    Kenny

  • Uhmmm what happened to the Sneak Preview Full Edition with Java AddIn?

    Anyone knows if the anouncement of the new Full ABAP edition 2004s is also the silent dead of the Full edition with Java stack add-in? It has mysteriously disappeared from the page...

    No

  • How can I make Edit/Default Customization form with Java ?

    In previous portal relise developers have simple way to rendering Edit/Default Customization form:
    <% PortletRendererUtil.renderCustomizeFormHeader(portletRequest, out, null, "services_action", null, null); %>
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="2">
    <TR>
    <TD>Days</TD>
    <TD><INPUT TYPE="text" NAME="services_days" VALUE="<%= days %>" SIZE="10"/></TD>
    </TR>
    <TR>
    <TD>Rows</TD>
    <TD><INPUT TYPE="text" NAME="services_rows" VALUE="<%= rows %>" SIZE="10"/></TD>
    </TR>
    </TABLE>
    <% PortletRendererUtil.renderCustomizeFormFooter(portletRequest, out); %>
    In current portal version I can not find these methods, these methods not exists in JavaDoc and in jar's. And all old code do not works!!! Why?
    I must hide portlet borders and use <renderContainer>false</renderContainer> in provider.xml. Then portal do not render Edit/Default Customization form in Edit/Default mode. In previous relise I can make this form with Java code.
    My question: how I can get Edit/Default Customization form in Edit/Default mode with Java code?
    Thanks in advance
    Cheslav

    Hi George, the trick is to figure out which browser is your default now, and remove that designation using the Android settings for Apps. It might be Chrome or it might be something Samsung provides.
    This article has more information: [[Make Firefox the default browser on Android]].
    Does it work?

  • Using Berkeley Java Edition with Java Web Start

    Hi
    Have anyone had any experience using Berkeley Java Edition with Java Web Start?. I need to create an application that will download with the database to a client computer and create the database there

    Thanks for your reply Luca-Sanna,
    This is my jnlp file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/dist" href="launch.jnlp">
    <information>
    <title>MyApplication</title>
    <vendor>My Company</vendor>
    <homepage href="/test.html"/>
    <description>My Test Application</description>
    <description kind="short">My Application</description>
    <icon href="test.gif" kind="default"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="myapp.jar" main="true" download="eager"/>
    <jar href="lib/appframework-1.0.3.jar" download="eager"/>
    <jar href="lib/beansbinding-1.2.1.jar" download="eager"/>
    <jar href="lib/commons-beanutils.jar" download="eager"/>
    <jar href="lib/commons-collections.jar" download="eager"/>
    <jar href="lib/commons-digester.jar" download="eager"/>
    <jar href="lib/commons-logging.jar" download="eager"/>
    <jar href="lib/derby.jar" download="eager"/>
    <jar href="lib/derbyclient.jar" download="eager"/>
    <jar href="lib/derbynet.jar" download="eager"/>
    <jar href="lib/itext-1.3.1.jar" download="eager"/>
    <jar href="lib/jasperreports-1.3.0.jar" download="eager"/>
    <jar href="lib/jbossall-client-2004-05-11.jar" download="eager"/>
    <jar href="lib/jdt-compiler-3.1.1.jar" download="eager"/>
    <jar href="lib/poi-2.0-final-20040126.jar" download="eager"/>
    <jar href="lib/swing-worker-1.1.jar" download="eager"/>
    <jar href="lib/toplink-essentials-agent.jar" download="eager"/>
    <jar href="lib/toplink-essentials.jar" download="eager"/>
    </resources>
    <application-desc main-class="mypackage.Login">
    </application-desc>
    </jnlp>
    I have seen many forums with the same above problem with no reply.
    Anyone knows what exactly the problem is?

  • Is there a way to create/edit registry keys with Java?

    I'm writing a console app and I'd like to have it so the users can change values in the registry. I'm not just talking about app keys I want any key. Is there a way to do this with Java?

    Maybe a forum search on "Windows registry" would turn up some useful things. You're not the first to ask this. You might save yourself and everyone else some time if you'd simply do that.

  • Execute Command "Update Data" of dynamic graphic xls with Java?

    hi, i want to write datas in tthe xls sheet, i have in other sheet from same file xls a dynamic graphic, and i want to update de graphic with the new datas writed, how can to execute the command "Update Data" in the dynamic graphi sheet??
    tnk for your help.
    HL

    You missed a space in the string after your WHERE clause.
    put an extra space after the 'WHERE' in your execute immediate statement.
         EXECUTE IMMEDIATE
              'UPDATE '|| affectedtable|| ' SET '|| affectedcol || '= :nvalue'||
              ' WHERE '|| affectedcol || '= :ovalue'
              USING newvalue, oldvalue ;

  • Spawn Unix Process in same shell with Java

    Hello,
    Does anyone know how to use java to prompt the user for input, execute their command, wait for the command to finish and then prompt them again.
    I am able to prompt the user for input, but if they type 'vi filename' and I execute it, the user never sees the vi screen to edit the file. I would like to be able to allow other programs like 'vi' to use the same command line terminal that the user is currently in with java. Currently executing any command is fine, and I can read the process i/o. The only problem is when a program like 'vi' needs the terminal. Does java prevent that from happening when spawning a process?
    Thanks,
    Rick

    Should this be command line based? There are several graphical java terminal emulators, here's an open source one for instance:
    http://javassh.org/wiki-view?oid=5F8180808080808080808080808086neotis

  • Answers access with Java (to enable more complex reports)?

    Hello and thanks for reading,
    I was wondering if there is a possibility to access BI Answers with Java (or an other procedural language) in order to realize more complex reports than what is possible with the graphical user interface.
    Is there an alternative way to access BI Answers in order to build reports, which provides one with a great flexibility in report design?
    Thanks for ideas
    Evgeny

    Are you trying to build more complex reports in OBIEE?
    If you need to customize the obiee you can do by editing the html files in BI server and data folders. You can add ur own html code and tags there. Also to achive more complex formating you can use OBIEE Publisher that will let you to create your own rtf or pdf templates and upload it to the dashboards
    Hope it helps
    Prash

  • Problem with drawing info from mysql on an image with java

    I'm trying to draw info on a jpg with java, the info is in a mysql database with columns for what I want to draw and 2 columns for the x,y. I would be glad for any pointers, help and advice.
    1. Strangely the program draws all the info on the same spot in the image. I have no idea what I'm doing wrong.
    2. is there a way to tell java to continue drawing until there are no more rows in the database?
    I deleted the database info.
    Thanks for any help
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import java.util.*;
    import java.sql.*;
    import javax.sql.*;
    public class carte4 {
        public static void main(String[] args)throws IOException {
        try {
    Statement stmt;
    ResultSet rs;
    com.mysql.jdbc.jdbc2.optional.MysqlDataSource ds;
    Connection conn2;
    ds = new com.mysql.jdbc.jdbc2.optional.MysqlDataSource();
    ds.setServerName("");
    ds.setDatabaseName("");
    conn2 = ds.getConnection("", "");
    stmt = conn2.createStatement();
    rs = stmt.executeQuery( "select * from territoire");
    // process results
    while (rs.next()) {
    String nom = rs.getString("nomterritoire");
    String proprio = rs.getString("nomperso");
    int unites = rs.getInt("unites");
    int coordx = rs.getInt("coordonesX");
    int coordy = rs.getInt("coordonesY");
         BufferedImage image = ImageIO.read(new File(args[0]));
    //remplire les territoires
    Graphics graphics = image.getGraphics();
              graphics.setColor(Color.black);
              graphics.drawString("a" + proprio + unites, coordx, coordy);
            graphics.drawString("b" + proprio) + unites, coordx, coordy);
            graphics.drawString("c" + proprio + unites, coordx, coordy);
              // save modified image
              String format = "JPG";
              ImageIO.write(image, format, new File(args[1]));Message was edited by:
    retosteffen

    Bill,
    Another very helpful solution and I appreciate knowing how to fix it in both applications. Thanks!
    Wolf

  • Custom graphics in java.awt.ScrollPane

    Hi all,
    I have to draw a custom created image in a scroll pane. As the image is very large I want to display it in a scroll pane. As parts of the image may change within seconds, and drawing the whole image is very time consuming (several seconds) I want to draw only the part of the image that is currently visible to the user.
    My idea: creating a new class that extends from java.awt.ScrollPane, overwrite the paint(Graphics) method and do the drawings inside. Unfortunately, it does not work. The background of the scoll pane is blue, but it does not show the red box (the current viewport is not shown in red).
    Below please find the source code that I am using:
    package graphics;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.ScrollPane;
    import java.awt.event.AdjustmentEvent;
    public class CMyComponent extends ScrollPane {
         /** <p>Listener to force a component to repaint when a scroll bar changes its
          * position.</p>
         private final class ScrollBarAdjustmentListener implements java.awt.event.AdjustmentListener {
              /** <p>The component to force to repaint.</p> */
              private final Component m_Target;
              /** <p>Default constructor.</p>
               * @param Target The component to force to repaint.
              private ScrollBarAdjustmentListener(Component Target) { m_Target = Target; }
              /** <p>Forces to component to repaint upon adjustment of the scroll bar.</p>
               *  @see java.awt.event.AdjustmentListener#adjustmentValueChanged(java.awt.event.AdjustmentEvent)
              public void adjustmentValueChanged(AdjustmentEvent e) { m_Target.paint(m_Target.getGraphics()); }
         public CMyComponent() {
              // Ensure that the component repaints upon changing of the scroll bars
              ScrollBarAdjustmentListener sbal = new ScrollBarAdjustmentListener(this);
              getHAdjustable().addAdjustmentListener(sbal);
              getVAdjustable().addAdjustmentListener(sbal);
         public void paint(Graphics g) {
              setBackground(Color.BLUE);
              g.setColor(Color.RED);
              g.fillRect(getScrollPosition().x, getScrollPosition().y, getViewportSize().width, getViewportSize().height);
         public final static void main(String[] args) {
              java.awt.Frame f = new java.awt.Frame();
              f.add(new CMyComponent());
              f.pack();
              f.setVisible(true);
    }

    Dear all,
    I used the last days and tried several things. I think now I have a quite good working solution (just one bug remains) and it is very performant. To give others a chance to see what I have done I post the source code of the main class (a canvas drawing and implementing scrolling) here. As soon as the sourceforge project is accepted, I will publish the whole sources at there. Enjoy. And if you have some idea for my last bug in getElementAtPixel(Point), then please tell me.
    package internetrail.graphics.hexgrid;
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Point;
    import java.awt.Polygon;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import java.awt.geom.Area;
    import java.awt.image.BufferedImage;
    import java.util.WeakHashMap;
    import java.util.Map;
    /** <p>Hex grid view.</p>
    * <p>Visualizes a {@link IHexGridModel}.</p>
    * @version 0.1, 03.06.2006
    * @author Bjoern Wuest, Germany
    public final class CHexGridView extends Canvas implements ComponentListener, IHexGridElementListener {
         /** <p>Serial version unique identifier.</p> */
         private static final long serialVersionUID = -965902826101261530L;
         /** <p>Instance-constant parameter for the width of a hex grid element.</p> */
         public final int CONST_Width;
         /** <p>Instance-constant parameter for 1/4 of the width of a hex grid element.</p> */
         public final int CONST_Width1fourth;
         /** <p>Instance-constant parameter for 3/4 of the width of a hex grid element.</p> */
         public final int CONST_Width3fourth;
         /** <p>Instance-constant parameter for 1.5 times of the width of a hex grid element.</p> */
         public final int CONST_Width1dot5;
         /** <p>Instance-constant parameter for 4 times of the width of a hex grid element.</p> */
         public final int CONST_Widthquad;
         /** <p>Instance-constant parameter for the height of a hex grid element.</p> */
         public final int CONST_Height;
         /** <p>Instance-constant parameter for 1/2 of the height of a hex grid element.</p> */
         public final int CONST_Heighthalf;
         /** <p>Instance-constant parameter for the double height of a hex grid element.</p> */
         public final int CONST_Heightdouble;
         /** <p>The steepness of a side of the hex grid element (calculated for the upper left arc).</p> */
         public final double CONST_Steepness;
         /** <p>The model of this hex grid </p> */
         private final IHexGridModel m_Model;
         /** <p>A cache for already created images of the hex map.</p> */
         private final Map<Point, Image> m_Cache = new WeakHashMap<Point, Image>();
         /** <p>The graphical area to draw the selection ring around a hex element.</p> */
         private final Area m_SelectionRing;
         /** <p>The image of the selection ring around a hex element.</p> */
         private final BufferedImage m_SelectionRingImage;
         /** <p>The current position of the hex grid in pixels (top left visible corner).</p> */
         private Point m_ScrollPosition = new Point(0, 0);
         /** <p>Flag to define if a grid is shown ({@code true}) or not ({@code false}).</p> */
         private boolean m_ShowGrid = true;
         /** <p>Flag to define if the selected hex grid element should be highlighted ({@code true}) or not ({@code false}).</p> */
         private boolean m_ShowSelected = true;
         /** <p>The offset of hex grid elements shown on the screen, measured in hex grid elements.</p> */
         private Point m_CurrentOffset = new Point(0, 0);
         /** <p>The offset of the image shown on the screen, measured in pixels.</p> */
         private Point m_PixelOffset = new Point(0, 0);
         /** <p>The index of the currently selected hex grid element.</p> */
         private Point m_CurrentSelected = new Point(0, 0);
         /** <p>The width of a buffered pre-calculated image in pixel.</p> */
         private int m_ImageWidth;
         /** <p>The height of a buffered pre-calculated image in pixel.</p> */
         private int m_ImageHeight;
         /** <p>The maximum number of columns of hex grid elements to be shown at once on the screen.</p> */
         private int m_MaxColumn;
         /** <p>The maximum number of rows of hex grid elements to be shown at once on the screen.</p> */
         private int m_MaxRow;
         /** <p>Create a new hex grid view.</p>
          * <p>The hex grid view is bound to a {@link IHexGridModel} and registers at
          * that model to listen for {@link IHexGridElement} updates.</p>
          * @param Model The model backing this view.
         public CHexGridView(IHexGridModel Model) {
              // Set the model
              m_Model = Model;
              CONST_Width = m_Model.getElementsWidth();
              CONST_Height = m_Model.getElementsHeight();
              CONST_Width1fourth = CONST_Width/4;
              CONST_Width3fourth = CONST_Width*3/4;
              CONST_Width1dot5 = CONST_Width*3/2;
              CONST_Heighthalf = CONST_Height/2;
              CONST_Widthquad = CONST_Width*4;
              CONST_Heightdouble = CONST_Height*2;
              CONST_Steepness = (double)CONST_Heighthalf / CONST_Width1fourth;
              m_ImageWidth = getSize().width+CONST_Widthquad;
              m_ImageHeight = getSize().height+CONST_Heightdouble;
              m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
              m_MaxRow = m_ImageHeight / CONST_Height;
              // Register this canvas for various notifications
              m_Model.addElementListener(this);
              addComponentListener(this);
              // Create the selection ring to highlight hex grid elements
              m_SelectionRing = new Area(new Polygon(new int[]{-1, CONST_Width1fourth-1, CONST_Width3fourth+1, CONST_Width+1, CONST_Width3fourth+1, CONST_Width1fourth-1}, new int[]{CONST_Heighthalf, -1, -1, CONST_Heighthalf, CONST_Height+1, CONST_Height+1}, 6));
              m_SelectionRing.subtract(new Area(new Polygon(new int[]{2, CONST_Width1fourth+2, CONST_Width3fourth-2, CONST_Width-2, CONST_Width3fourth-2, CONST_Width1fourth+2}, new int[]{CONST_Heighthalf, 2, 2, CONST_Heighthalf, CONST_Height-2, CONST_Height-2}, 6)));
              m_SelectionRingImage = new BufferedImage(CONST_Width, CONST_Height, BufferedImage.TYPE_INT_ARGB);
              Graphics2D g = m_SelectionRingImage.createGraphics();
              g.setColor(Color.WHITE);
              g.fill(m_SelectionRing);
         @Override public synchronized void paint(Graphics g2) {
              // Caculate the offset of indexes to show
              int offsetX = 2 * (m_ScrollPosition.x / CONST_Width1dot5) - 2;
              int offsetY = (int)(Math.ceil(m_ScrollPosition.y / CONST_Height) - 1);
              m_CurrentOffset = new Point(offsetX, offsetY);
              // Check if the image is in the cache
              Image drawing = m_Cache.get(m_CurrentOffset);
              if (drawing == null) {
                   // The image is not cached, so draw it
                   drawing = new BufferedImage(m_ImageWidth, m_ImageHeight, BufferedImage.TYPE_INT_ARGB);
                   Graphics2D g = ((BufferedImage)drawing).createGraphics();
                   // Draw background
                   g.setColor(Color.BLACK);
                   g.fillRect(0, 0, m_ImageWidth, m_ImageHeight);
                   // Draw the hex grid
                   for (int column = 0; column <= m_MaxColumn; column += 2) {
                        for (int row = 0; row <= m_MaxRow; row++) {
                             // Draw even column
                             IHexGridElement element = m_Model.getElementAt(offsetX + column, offsetY + row);
                             if (element != null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)), CONST_Height*row, null); }
                             // Draw odd column
                             element = m_Model.getElementAt(offsetX + column+1, offsetY + row);
                             if (element!= null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)+CONST_Width3fourth), CONST_Heighthalf*(row*2+1), null); }
                   // Put the image into the cache
                   m_Cache.put(m_CurrentOffset, drawing);
              // Calculate the position of the image to show
              offsetX = CONST_Width1dot5 + (m_ScrollPosition.x % CONST_Width1dot5);
              offsetY = CONST_Height + (m_ScrollPosition.y % CONST_Height);
              m_PixelOffset = new Point(offsetX, offsetY);
              g2.drawImage(drawing, -offsetX, -offsetY, null);
              // If the selected element should he highlighted, then do so
              if (m_ShowSelected) {
                   // Check if the selected element is on screen
                   if (isElementOnScreen(m_CurrentSelected)) {
                        // Correct vertical offset for odd columns
                        if ((m_CurrentSelected.x % 2 == 1)) { offsetY -= CONST_Heighthalf; }
                        // Draw the selection circle
                        g2.drawImage(m_SelectionRingImage, (m_CurrentSelected.x - m_CurrentOffset.x) * CONST_Width3fourth - offsetX - ((m_CurrentSelected.x + 1) / 2), (m_CurrentSelected.y - m_CurrentOffset.y) * CONST_Height - offsetY, null);
         @Override public synchronized void update(Graphics g) { paint(g); }
         public synchronized void componentResized(ComponentEvent e) {
              // Upon resizing of the component, adjust several pre-calculated values
              m_ImageWidth = getSize().width+CONST_Widthquad;
              m_ImageHeight = getSize().height+CONST_Heightdouble;
              m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
              m_MaxRow = m_ImageHeight / CONST_Height;
              // And flush the cache
              m_Cache.clear();
         public void componentMoved(ComponentEvent e) { /* do nothing */ }
         public void componentShown(ComponentEvent e) { /* do nothing */ }
         public void componentHidden(ComponentEvent e) { /* do nothing */ }
         public synchronized void elementUpdated(IHexGridElement Element) {
              // Clear cache where the element may be contained at
              for (Point p : m_Cache.keySet()) { if (isElementInScope(Element.getIndex(), p, new Point(p.x + m_MaxColumn, p.y + m_MaxRow))) { m_Cache.remove(p); } }
              // Update the currently shown image if the update element is shown, too
              if (isElementOnScreen(Element.getIndex())) { repaint(); }
         /** <p>Returns the model visualized by this grid view.</p>
          * @return The model visualized by this grid view.
         public IHexGridModel getModel() { return m_Model; }
         /** <p>Returns the current selected hex grid element.</p>
          * @return The current selected hex grid element.
         public IHexGridElement getSelected() { return m_Model.getElementAt(m_CurrentSelected.x, m_CurrentSelected.y); }
         /** <p>Sets the current selected hex grid element by its index.</p>
          * <p>If the selected hex grid element should be highlighted and is currently
          * shown on the screen, then this method will {@link #repaint() redraw} this
          * component automatically.</p>
          * @param Index The index of the hex grid element to become the selected one.
          * @throws IllegalArgumentException If the index refers to a non-existing hex
          * grid element.
         public synchronized void setSelected(Point Index) throws IllegalArgumentException {
              // Check that the index is valid
              if ((Index.x < 0) || (Index.y < 0) || (Index.x > m_Model.getXElements()) || (Index.y > m_Model.getYElements())) { throw new IllegalArgumentException("There is no hex grid element with such index."); }
              m_CurrentSelected = Index;
              // If the element is on screen and should be highlighted, then repaint
              if (m_ShowSelected && isElementOnScreen(m_CurrentSelected)) { repaint(); }
         /** <p>Moves the visible elements to the left by the number of pixels.</p>
          * <p>To move the visible elements to the left by one hex grid element, pass
          * {@link #CONST_Width3fourth} as the parameter. The component will
          * automatically {@link #repaint()}.</p>
          * @param Pixels The number of pixels to move to the left.
          * @return The number of pixels moved to the left. This is always between 0
          * and {@code abs(Pixels)}.
         public synchronized int moveLeft(int Pixels) {
              int delta = m_ScrollPosition.x - Math.max(0, m_ScrollPosition.x - Math.max(0, Pixels));
              if (delta != 0) {
                   m_ScrollPosition.x -= delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements up by the number of pixels.</p>
          * <p>To move the visible elements up by one hex grid element, pass {@link
          * #CONST_Height} as the parameter. The component will automatically {@link
          * #repaint()}.</p>
          * @param Pixels The number of pixels to move up.
          * @return The number of pixels moved up. This is always between 0 and {@code
          * abs(Pixels)}.
         public synchronized int moveUp(int Pixels) {
              int delta = m_ScrollPosition.y - Math.max(0, m_ScrollPosition.y - Math.max(0, Pixels));
              if (delta != 0) {
                   m_ScrollPosition.y -= delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements to the right by the number of pixels.</p>
          * <p>To move the visible elements to the right by one hex grid element, pass
          * {@link #CONST_Width3fourth} as the parameter. The component will
          * automatically {@link #repaint()}.</p>
          * @param Pixels The number of pixels to move to the right.
          * @return The number of pixels moved to the right. This is always between 0
          * and {@code abs(Pixels)}.
         public synchronized int moveRight(int Pixels) {
              int delta = Math.min(m_Model.getXElements() * CONST_Width3fourth + CONST_Width1fourth - getSize().width, m_ScrollPosition.x + Math.max(0, Pixels)) - m_ScrollPosition.x;
              if (delta != 0) {
                   m_ScrollPosition.x += delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements down by the number of pixels.</p>
          * <p>To move the visible elements down by one hex grid element, pass {@link
          * #CONST_Height} as the parameter. The component will automatically {@link
          * #repaint()}.</p>
          * @param Pixels The number of pixels to move down.
          * @return The number of pixels moved down. This is always between 0 and
          * {@code abs(Pixels)}.
         public synchronized int moveDown(int Pixels) {
              int delta = Math.min(m_Model.getYElements() * CONST_Height + CONST_Heighthalf - getSize().height, m_ScrollPosition.y + Math.max(0, Pixels)) - m_ScrollPosition.y;
              if (delta != 0) {
                   m_ScrollPosition.y += delta;
                   repaint();
              return delta;
         /** <p>Checks if the hex grid element of the given index is currently
          * displayed on the screen (even just one pixel).</p>
          * <p>The intention of this method is to check if a {@link #repaint()} is
          * necessary or not.</p>
          * @param ElementIndex The index of the element to check.
          * @return {@code true} if the hex grid element of the given index is
          * displayed on the screen, {@code false} if not.
         public synchronized boolean isElementOnScreen(Point ElementIndex) { return isElementInScope(ElementIndex, m_CurrentOffset, new Point(m_CurrentOffset.x + m_MaxColumn, m_CurrentOffset.y + m_MaxRow)); }
         /** <p>Checks if the hex grid element of the given index is within the given
          * indexes.</p>
          * <p>The intention of this method is to check if a {@link #repaint()} is
          * necessary or not.</p>
          * @param ElementIndex The index of the element to check.
          * @param ReferenceIndexLeftTop The left top index of the area to check.
          * @param ReferenceIndexRightBottom The right bottom index of the area to check.
          * @return {@code true} if the hex grid element of the given index is within
          * the given area, {@code false} if not.
         public synchronized boolean isElementInScope(Point ElementIndex, Point ReferenceIndexLeftTop, Point ReferenceIndexRightBottom) { if ((ElementIndex.x >= ReferenceIndexLeftTop.x) && (ElementIndex.x <= ReferenceIndexRightBottom.x) && (ElementIndex.y >= ReferenceIndexLeftTop.y) && (ElementIndex.y <= (ReferenceIndexRightBottom.y))) { return true; } else { return false; } }
         /** <p>Return the {@link IHexGridElement hex grid element} shown at the given
          * pixel on the screen.</p>
          * <p><b>Remark: There seems to be a bug in retrieving the proper element,
          * propably caused by rounding errors and unprecise pixel calculations.</p>
          * @param P The pixel on the screen.
          * @return The {@link IHexGridElement hex grid element} shown at the pixel.
         public synchronized IHexGridElement getElementAtPixel(Point P) {
              // @FIXME Here seems to be some bugs remaining
              int dummy = 0; // Variable for warning to indicate that there is something to do :)
              // Calculate the pixel on the image, not on the screen
              int px = P.x + m_PixelOffset.x;
              int py = P.y + m_PixelOffset.y;
              // Determine the x-index of the column (is maybe decreased by one)
              int x = px / CONST_Width3fourth + m_CurrentOffset.x;
              // If the column is odd, then shift the y-pixel by half element height
              if ((x % 2) == 1) { py -= CONST_Heighthalf; }
              // Determine the y-index of the row (is maybe decreased by one)
              int y = py / CONST_Height + m_CurrentOffset.y;
              // Normative coordinates to a single element
              px -= (x - m_CurrentOffset.x) * CONST_Width3fourth;
              py -= (y - m_CurrentOffset.y) * CONST_Height;
              // Check if the normative pixel is in the first quarter of a column
              if (px < CONST_Width1fourth) {
                   // Adjustments to the index may be necessary
                   if (py < CONST_Heighthalf) {
                        // We are in the upper half of a hex-element
                        double ty = CONST_Heighthalf - CONST_Steepness * px;
                        if (py < ty) { x--; }
                   } else {
                        // We are in the lower half of a hex-element
                        double ty = CONST_Heighthalf + CONST_Steepness * px;
                        if (py > ty) {
                             x--;
                             y++;
              return m_Model.getElementAt(x, y);
    }Ah, just to give you some idea: I use this component to visualize a hex grid map with more than 1 million grid elements. And it works, really fast, and requires less than 10 MByte of memory.

  • 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

  • XSLT Mapping with Java Enhancement

    Hi All
    I am working on XSLT Mapping with Java Enhancement.
    To do this scenario i have followed the following link.
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    As per the above link I have created Source and Target Data Types , Message Types , Mesage Interfaces, XSLT Mapping (using the transaction XSLT_TOOL) and Interface Mapping part and configred a simple file to file scenario in the ID part.
    Apart from this I have wirte the java code, compile the java code, create the jar file using .java and .class file and after creating the jar file import the .jar file in the imported archive of the IR..
    when I am trying to execute the scenario I am getting the successful message in SXMB_MONI but the target file is having the payload as given below.
    <?xml version ="1.0" encoding="UTF-8"?>
    <name xmlns:javamap="java:com.company.group.MappingClass"/>
    And as per the XSLT mapping the payload should be as below
    <?xml version ="1.0" encoding="UTF-8"?>
    <person>
    <name>Rinku Gangwani</name>
    </person>
    I have also followed the following blog link but still i am getting the same issue
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    could you please tell me what can be the reason that i am getting the blank targt field values in the payload.
    Thanks
    Rinku Gangwani

    Hi,
      The Transaction code XSLT_TOOL for ABAP xslt mapping.But the Java Enhancement is used for normal xslt mapping which we created using Stylus Studio.You can not access the Java Enhancement in ABAP xslt mapping.
    If you want to use Java Enhancement in xslt mapping then create a xslt mapping using Stylus Studio and save the file as .xsl and zip the .xsl and import to import archive.
    Regards,
    Prakasu.M
    Edited by: prakasu on May 28, 2009 1:46 PM

  • BC-XI V3.0 Message Mapping with Java Class

    Hi all
    In the Integretion Builder Design i try to import a Java Class in order to convert a source to a target field. I have created an tested the class with the eclipse V3.0.
    If i import the source in a customized mapping function i always get the error:
    "OFFMANNONLINESHOP_ORDER2SAP_ORDERS05_MSGMAP01 hat keinen Quellkode."    (...message..has no source code)
    I have also imported the import classes in the "Imported Archives".
    This message always appear if the import line for the classes is filled.
    Do somebody knows this problem
    Message was edited by: Christoph Borst
    Message was edited by: Christoph Borst
    Message was edited by: Christoph Borst

    Hi ,
    select XMLTOOLKIT option in Operation mapping and execute it.
    I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
    then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
    Regards,
    Raj

Maybe you are looking for

  • Unable to connect the queue in AQ with weblogic 10G R3

    I created queues, queue tables and started the queue in Oracle 10g. In weblogic, i configured staturpclass using http://www.oracle.com/technology/products/ias/oems/files/aqjmsv2.0.zip_ and weblogic able to create the JNDI names as configured in aqjms

  • Taxes management for customers

    Hi SAP experts. We need to manage certain tax for each of our customers in the sales process, nevertheless, depending on the kind of material they are buying there could be a witholding tax. How can we configure these tax rules so that the tax and th

  • Document library: When to rename a file

    Hello, In a document library, I need to rename every file inserted there. For example, the file aa.docx should be renamed in 2014-03-04-aaa.docx. I don't mind doing that before or after the popup window comes with the file's properties. What should b

  • No userstore Active in trc file

    Hi all, i need some big help here.. im upgrading my Java server from 640Sp19 to 7.0sp13.. ( the installation default is SP9 then i have put it SP13 to the epsinbox of the jupgrade ) my Os is Aix 5.3ML6 my DB ora 10.2.0.2 now my jupgrade is in START_J

  • BAPI or FM to get Material Price

    Is there a readily available BAPI or Function Module that can get me a meterial's price based on it's pricing procedure?