CVS Diff functionality in Java

Hi,
I've got a requirement for an application to implement a functionality same as "CVS diff " functionality . Is there any way to implement it in Java. If its possible then please let me know.
Thnx
Sidd

http://www.jcvs.org/
http://javacvs.netbeans.org/library/
http://www.darwinsys.com/freeware/Diff.java
http://www.google.co.uk/search?hl=en&q=Java+diff
http://www.google.co.uk/search?hl=en&q=Java+cvs&meta=
Hi mlk,
Thanx for the references. Its definitely going to help me in getting a soln for my reqmt.
..Sidd

Similar Messages

  • Regarding CVS Diff Display

    Hi,
    I have to display the CVS Diff in a page where one side of the page will have all the deletions('<' of the Diff) and the other side of the page will have all the additions('>'s of the Diff). Can someone please let me know whether there is an already existing API to do this or if someone has already done this? Please let me know if there is an Eclipse Plugin or any open source code to do this.
    Thanks

    Hi,
    To create pf status goto se41 and create your pf status or from object list of your program by right clicking on your program name create gui_status..
    Then within a form endform...write..
    *&      Form  SET_PF_STAT_F14
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_standard USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD'. " say standard is the name of your pf-status...maintain in all caps
    ENDFORM.                    " set_pf_status
    and pass it...
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
      i_callback_program                = sy-repid
       i_callback_pf_status_set          = 'SET_STANDARD'  " pass the pf-status
    In alv it is not required to create one...but as in your case it is not comming try creating one..
    Regards
    Debarshi

  • Lookiing for example of a user define aggregate function in Java

    I want to write an aggregate function in Java. Every example I found is in PL/SQL.
    I have written my fair share of JSPs, but this is different in that it is methods off an object.
    The documentation says it can be done in Java, but it's not clear to me how to define the ODCIAggregateInitialize, ODCIAggregateIterate, ODCIAggregateTerminate, and ODCIAggregateMerge methods.
    If any one can point me to, or send me, an example, I would be very grateful.
    TIA

    Hii Greg:
    You can find the code to implement a Domain Index for Oracle which uses ODCI Api in Java at.
    http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/src/java/org/apache/lucene/indexer/LuceneDomainIndex.java?revision=1.29&view=markup
    This is the code of the implementation of the Lucene Domain Index:
    http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg
    The strategy to implement an use aggregate function is similar to implement a Domain Index.
    The PLSQL wrapper for the above code is:
    http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/LuceneDomainIndex.sql?revision=1.20&view=markup
    Take a look at the code and if you have another question just drop me an email or post again into this list.
    Best regards, Marcelo.

  • UNIX "diff" as a Java fuction or API ?

    Hi,
    I want to compare compare / differentiate two files and get a result like from the UNIX "diff"... all this as a Java API, function or tool. Does somebody know about something that could help ???
    thanks
    Kevin

    Well, it's for a prototype under Windows NT/2000... I got the cygwin Windows port of "diff", but a Java API would be most convenient I think.
    Further I will also need something for a binary differentiation...
    Kevin

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Writing message mapping function in Java in integration repository

    Hi XI Pundits,
    I am new to XI. I was working on Message mapping in intergration repository.
    To map the source messages to target messages, we do graphical kind of mapping like drag and drop.
    There are some functions aavilable at the bottom like concatehate, trim and etc. which we use if we need to modify the source message and map to target.
    But in case we face a situation when we don't find the function which suits our requirement, I guess we need to write a new function. We can write these new function using Java only.
    Can someone throw some light on this ?
    <b>What do we do to invoke java editor in integartion reposity to write mapping function in java ?
    Can someone give an example of snippet of code ?</b>
    Thanks.

    Hi Tushar,
    Go thro this help link. You will get all info about User defined function.
    http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/frameset.htm
    To get more understanding on mapping go thro this link(PDF File)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    Hope this helps.
    regards,
    P.Venkat
    Message was edited by: Venkataramanan

  • Can we call java function in java script????

    hello
    please tell me can i call a java function through java script function in jsp???

    of course not. JavaScript is interpreted by the client (web browser) while the Java code in a JSP resides on the server. don't confuse the web application's architecture.
    robert

  • How to use cvs checkout command in java

    Hi,
    I am using Ubuntu
    I have installed cvs client in ubuntu
    I have one problem running 'cvs checkout' command through java..
    "cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
    When i run the above command in terminal, i got one prompt like '[email protected]'s password:' in the terminal if i give the valid password the folder 'Auto' checked out successfully..
    I have tried following steps but i don't know how to give the password to the terminal using java
    First i created the 'checkout.sh' file.
    In this i have typed "cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
    Then i call it using java by the following code
    =================================================================
    String cmd[] = {"bash","checkout.sh"};
    Runtime.getRuntime().exec(cmd).waitFor();
    =================================================================
    Anyone let me know how do I achieve this in java?
    Thanks in Advance
    Kulandaivelu

    masijade. wrote:
    PhHein wrote:
    Maybe you need to modify your links to be more obvious :P
    [*>>klick me<<*|http://www.jcvs.org/]
    Nah! Attention to detail is one of most crucial attributes for a programmer in any language. ;-)
    Edit: The urls seemingly don't like h1 and color tags. ;-)Nope, they don't and I couldn't be bothered to try.
    Gratz on Gold!

  • FM call from Variant Function in JAVA SCE

    Hello,
    I have an issue with Variant Configuration in CRM WEB UI / WebShops.
    We have created a variant function in ECC to read/pull a customer master value (KNVV table).  This is working fine in ECC & got the desired result.
    Now we need replicate the same in CRM. For this we need to create KB, Version & write a variant function in Java class in SCE. In that variant function we need to call a function module and get the customer master / Business partner value as similar to ECC process described above.
    But we see that the SAP standard is not supporting FM calls from VF in Java. i.e. we are unable to call the JCO call to a CRM function module from SCE.  The package for User defined classes "com.sap.sce.user" and the method inside it public boolean execute(fn_args args, Object obj) { ..... } has no option to make a FM call.
    Has anyone faced the similar requirement and has any resolution for this? 
    Thanks,
    Surya.

    Hi Eric,
    You sound quite familiar with the variant functions. I am also working on IPC-SCE
    variant functions for few years now.
    We have a situation where I am building some debug logs in one java variant function and want to display it to the web UI at some condition.
    Is there any object(like context etc.) that IPC server-side and Webapps share?
    I can write that log to a text file and read it from web ui ... but I wanna avoid that.
    Is there any other way you know of???
    Regards,
    Ruchika

  • How to access C/C++ functions in Java using existing .dll library

    Hi JNI Guru's,
    I am having well written API in C/C++.This C/C++ files are made into *.dll files.The api are working fine.
    I wan't access the C/C++ api functions in Java., just using System.LoadLibrary("*.dll").Is it possible.I kindly request you to suggest some examples and how to do this.
    Its Urgent !.
    Thanks and Regards,
    V K LAL

    In general you cannot simply access dlls that have already been written. The DLLs called using JNI must conform to JNI calling standards.
    This means you will probably have to write one or more "wrapper" dlls which a) provide the correct JNI interface, and b) call the existing dlls.
    There are some programs around that claim to be able to generate such wrappers. Try a google search for "wrapper", "jni", "generate".
    The JNI tutorial covers creating wrappers.

  • Calling c functions in java

    How do I call c functions from java?

    See http://java.sun.com/docs/books/tutorial/native1.1/index.html

  • Calling a SP or Function from Java receiving a geometry(MDSYS.SDO_GEOMETRY)

    Hi there,
    What I want to do is: calling a stored procedure OR function from Java with a String-variable as input and receiving a geometry (SDO_GEOMETRY).
    I’m facing currently the problem of calling a stored function on oracle 11g from Java using JPA (EclipseLink), Spring 2.5.6 returning an MDSYS.SDO_GEOMETRY object.
    I’ve tried to call a stored procedure with MDSYS.SDO_GEOMETRY as an output parameter instead, but with no success.
    The function’s signature looks like this:
    CREATE or REPLACE
    FUNCTION GET_GEO_BRD_FUNCTION(p_geo_brd_id IN VARCHAR2) RETURN MDSYS.SDO_GEOMETRY AS
    sdo_geom    MDSYS.SDO_GEOMETRY := null;
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        FROM geo_brd WHERE id = p_geo_brd_id;
      RETURN sdo_geom;
    END;
    The calling code looks like this:
    MyClass extends JpaDaoSupport{
       /** logger */
       protected static final ILogger LOG = LogFactory.getLogger(MyClass.class);
        * {@inheritDoc}
        * @see com.example.MyClass#calculateGeometry(java.lang.String)
       @Override
       public JGeometry calculateGeometry(final String id) {
           JGeometry geometry = null;
           final JpaCallback action = new JpaCallback() {
                @Override
                public Object doInJpa(final EntityManager em) throws PersistenceException {
                   final Session session = JpaHelper.getEntityManager(em).getActiveSession();
                   final StoredFunctionCall functionCall = new StoredFunctionCall();
                   functionCall.setProcedureName("GET_GEO_BRD_FUNCTION");
                   functionCall.addNamedArgument("p_geo_brd_id");
                   functionCall.setResult("sdo_geom", Oracle.sql.STRUCT.class);
                   final ValueReadQuery query = new ValueReadQuery();
                   query.setCall(functionCall);
                   query.addArgument("p_geo_brd_id");
                   final ArrayList args = new ArrayList();
                   args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
                   final Object result = session.executeQuery(query, args);
                   return result;
        final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
        try {
           geometry = JGeometry.load(result);
        } catch (final SQLException e) {
           MyClass.LOG.error("Error loading JGeometry from STRUCT.", e);
           return null;
        return geometry;
    And when I execute the query I get the following error:
    Internal Exception: java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00382: expression is of wrong type
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN ? := GET_GEO_BRD_FUNCTION(p_geo_brd_id=>?); END;
         bind => [=> sdo_geom, 2e531e62-2105-4522-978a-ab8baf19e273]
    Query: ValueReadQuery()
    So I thought may be let's try it with a stored procedure instead...
    The procedure looks like this:
    CREATE or REPLACE
    PROCEDURE GET_GEO_BRD_PROCEDURE(p_geo_brd_id IN VARCHAR2, sdo_geom OUT MDSYS.SDO_GEOMETRY) AS
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        from geo_brd where id = p_geo_brd_id;
    END;
    The calling Java code in case of the stored procedure looks like this (only the content of the JPACallback has changed):
    @Override
    public Object doInJpa(final EntityManager em) throws PersistenceException {
        final Session session = JpaHelper.getEntityManager(em).getActiveSession();
        final StoredProcedureCall spCall = new StoredProcedureCall();
        spCall.setProcedureName("GET_GEO_BRD_PROCEDURE");
        spCall.addNamedArgument("p_geo_brd_id", "p_geo_brd_id", String.class);
        spCall.addNamedOutputArgument("sdo_geom", "sdo_geom", OracleTypes.STRUCT);
        final ValueReadQuery query = new ValueReadQuery();
        query.setCall(spCall);
        query.addArgument("p_geo_brd_id"); // input
        final List args = new ArrayList();
        args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
        final Object result = session.executeQuery(query, args);
        return result;
    And when I execute the query I get the following error:
    java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00306: wrong number or types of arguments in call to 'GET_GEO_BRD_PROCEDURE'
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    So both exceptions look quite similar.
    I guess in both cases the exception description leads to the assumption, that the wrong type for the return value / output parameter is used…
    So - how can a receive a MDSYS_SDO_GEOMETRY object from a stored procedure or stored function in Java ?
    What is wrong in the Java code?
    Thank you in advance for any suggestions!
    Yours,
    Chris
    Edited by: user3938161 on 20.12.2011 07:46
    Edited by: user3938161 on Dec 20, 2011 8:06 AM: added variable declaration of JGeometry geometry in source code

    Thanks, that did the trick! ;-)
    Here is now the code for stored procedure and function for anybody else encountering the same troubles... (be aware of the parameter order and/or naming!)
    Code for stored functions:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
         final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored functions
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{? = call GET_GEO_BRD_FUNCTION(?)}");
                cs.registerOutParameter(1, OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.setString(2, "2e531e62-2105-4522-978a-ab8baf19e273");//TODO: hardcoded for test
                cs.execute();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
             if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject(1);
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
          } finally {
             try {
                if (_conn != null && !_conn.isClosed()) {
                    _conn.close();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
          return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
    The code for stored procedure solution:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
          final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored procedure
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{call GET_GEO_BRD_PROCEDURE(?,?)}");
                cs.setString("p_geo_brd_id", "2e531e62-2105-4522-978a-ab8baf19e273");
                cs.registerOutParameter("sdo_geom", OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.execute();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
              if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject("sdo_geom");
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
           } finally {
              try {
                if (_conn != null && !_conn.isClosed()) {
                   _conn.close();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
            return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);

  • Any Mod function in JAVA?

    I did not find 'MOD' function in the Math class. Is there any 'MOD' function in Java?
    Thanks!

    What is your MOD function?
    Does the %-operator do what you need or do you want a strict mathematical modulus that returns only positive values?

  • Why static is used before any function in java

    Sir/Madem
    I'm new in java. I have just started learning java.
    please tell me
    "why static is used before any function in java??????"
    I have searched on net and in soime bokks .But i was unable toget it. what is exact reson of using static in java.

    tandm-malviya wrote:
    Sir/Madem
    I'm new in java. I have just started learning java.
    please tell me
    "why static is used before any function in java??????"
    I have searched on net and in soime bokks .But i was unable toget it. what is exact reson of using static in java.It's actually seldom used in "real" applications. static associates the method with the class instead of an instance.
    Kaj

  • The troubles with creating SQL function in Java

    Hi!
    I use Oracle 10g and connect to it from Java application. I need in creating SQL functions from Java code.
    In Java I have:
    Statement stm = null; try{     stm = dbConnection.createStatement();     stm.executeUpdate( query ); }catch(SQLException ex){     throw ex; }finally{     try{ stm.close(); }catch(Exception ex){ stm.close(); } }
    And I'm passing the next SQL function:
    create or replace function get_me return number is
    result number;
    begin
    select 5 into result from dual;
    return result;
    end;
    This code is run successful, but I can't call this funtion, because it has status Invalid
    I'm looked the next error: PLS-00103: Encountered the symbol "" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate
    But I don't understand, What the matter? From Oracle Enterprise Manager I can create this function without problems. So, I wrote the wong Java code. Also, I can't find my error :(
    May be, do u have the some ideas?
    Thank you very much!

    Post the whole pl/sql code please.
    To run PL/SQL from within java you'll need callablestatement.
    [here |http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java] an example : http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java

Maybe you are looking for