Add code To stander Java Clsess

I have requirement to add button in stander OA Page To Print Report I need to implement this solution
http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework
I Follow this step
1- take all mds file from CE application to my project
2- take all classes file to classless
3- open the project in jdeveloper
4- add button to BankAccountTransferPG.xml
5- run the application
all of this steps working fine and my application run with new button
my problem is i need to put code under the button fire and after searching for java code in my application i didn't find any thig
i found only classes file
can any one help me how to find stander java code to put new method
thanks

Hi,
You cannot modify standard class files. You have to create a new custom java controller file and extend that from standard controller class.
However just for refering, u can use cavaj software to de-complie those class files.
--Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How can i add more statements in java code dynamically...

    I have a (business works) BW process in TIBCO which has many activities including �java code�. In java code activity I have some if statements like
    if (Country.equals("USA�))
    Country code = 1
    else if(Country.equals("GERMANY�))
    Country code = 49
    the above information is coming from database. now my project is deployed and running. In future, if they add more countries in database how I can include them dynamically without changing my BW process java code activity and redeploying again. Is there any solution?
    Please advice.

    You won't reconfigure the Java application without redeploying. This is one of the reasons that including data in the code is bad.
    If you created a file which contained data like this:
    Canada <tab> 1
    USA <tab> 12
    Germany <tab> 6
    Then your program could read the file into a map. The map could be used to lookup the country code based on the name.
    In the future, you could change the file to:
    Canada <tab> 1
    USA <tab> 12
    Germany <tab> 6
    France <tab> 17
    China <tab> 2
    And the program wouldn't need to be changed. You would just need to send out the new country file.

  • Diff was java add in and stand alone java instance

    Hi Guys ,
    What is the diff between  was java add in and stand alone java instance ?
    Thanks
    Sonam

    Hai,
    SCS is nothing but the SAP Central Services, it is AS Java instance of an SAP system containing the enqueue server and the message server.
    JAVA Addin is inserted in exsisting ABAP only instance to have JAVA functionality. JAVA instance is assigned to an ABAP instance. The Internet Communication Manager (ICM) of the ABAP instance starts and stops the associated Java instance as required.
    Netweaver JAVA (Stand alone) vs JAVA Addin:
    Netweaver JAVA Addin installation is a dual installation that consists of Java and ABAP stack. Addin is required when you are implementing SAP XI (Exchange Infrastructure). Stand alone JAVA is required when you implement SAP EP (Enterprise Portal). It is generally not recommended to use dual installation for EP because this will expose the ABAP layer to the public Internet. So the ABAP stack is often used to host SAP ERP ECC (Enterprise Central Component), SAP CRM, SAP SCM, etc.,
    Since the information hosted on ABAP stack is more sensitive in nature you are recommended to install Portal on the Netweaver AS Java server (Stand alone JAVA server).
    By doing this you will be able to fully utilize the system resources for the portal and ensure good performance.
    Regards,
    Yoganand.V

  • Import statement code generation from Java-Platform Model in Java Studio

    Problem : When you create a Java-Platform Model type project in Java Studio 8.1 and as an example You would like to create an Attribute with java.util.Date type for a Class than how can You set this Attribute type in order to create the Code Generator the standard java package reference in Your code like : "import java.util.Date;" ? What is the right syntax in the "Type'" field of the Attribute Properties dialog ?

    You should also consider using NetBeans as an alternative to JSE8.1.
    Java Studio Enterprise 8.1 is itself built on top of NetBeans version 5.0. NetBeans is an ide developed as opensource at www.netbeans.org; it is extensible ide and so add-on modules can be developed to run on top of netbeans. And that is what JSE8.1 does; JSE 8.1 is NetBeans 5.0 plus several add-on modules (like UML etc).
    The latest stable version of NetBeans is 6.0 and provides improved versions of all relevant addons found in JSE.
    Home page: www.netbeans.org
    Download: http://www.netbeans.info/downloads/index.php
    Docs: http://www.netbeans.org/kb/index.html
    Further community resources (mailing lists, issue tracking etc) : http://www.netbeans.org/community/index.html
    wiki.netbeans.org
    NetBeans download is free. And since it is developed as an opensource project, the source is freely available under CDDL license.

  • Add code to a button?

    Hi friends,
    [Apps R12]
    If I add a button to an OAF screen :
    I have no idea of how :
    - to add code when it's clicked... The idea would be to call a database procedure that receives,as parameters, certain values of that OAF screen and that returns, in an output parameter, a value to be posted in a screen field.
    Any example would be appreciated
    Thanks!
    Jose L.

    Hi
    Please first go through with OADEVGUIDE,u can download the same form meta link (Note.730053.1). and haave practice seesion with labsolutions excercise . please find a sample code below for the problem
    package oracle.apps.fnd.framework.toolbox.labsolutions.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.OABodyBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
    import java.util.Enumeration;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    * Controller for ...
    public class EmpSearchPGLayOutRNCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if (pageContext.getParameter("clearclearButton")!=null)
    OADBTransaction txn = getDBTransaction();
    CallableStatement cs =
    txn.createCallableStatement("begin dbms_application_info.set_module(:1, :2);
    end;");
    try{
    cs.setString(1, module);
    cs.setString(2, action);
    cs.execute();
    cs.close();
    catch (SQLException e)
    try { cs.close } catch (Exception(e) {}
    throw OAException.wrapperException(sqle); }
    }

  • No way to add code snippets to the palette in 11g

    Hello,
    According to the Help Center, I should be able to add "codes snippets" to my palette, like I used in 10g...
    Adding a Code Snippet to the Palette
    You can add pages to the Component Palette to group your snippets, or you can add snippets to the existing Code Snippets page. Once you add snippets to the Palette, you can insert this code into any file you have open in the source editor by selecting the snippet from the Palette
    within the Configure Component Palette dialog. In the Configure Component Palette dialog, for Page Type select snippet to view only those pages containing snippets.
    Well , in the Page Type drop list , I only see "java" and "use case" ?
    I am running J2EE Edition Version 11.1.1.0.1 Build JDEVADF_MAIN.BOXER_GENERIC_081203.1854.5188
    Any thoughts ?
    Cheers

    If all you want is code snippet why not use the code template feature?
    It is more dynamic and will allow you to use variables that you can switch - then you can just use the keyboard to get the value.
    See:
    http://www.oracle.com/technology/obe/obe11jdev/11/ide/introjdevide.htm#t4s1
    http://adfjsf.blogspot.com/2009/09/creating-code-templates-in-jdeveloper.html

  • Switching between Design and JSP tabs add code?

    I am new to SJSC and I am taking the time to go through all of the little odds & ends of the IDE.
    I was looking at:
    http://blogs.sun.com/roller/page/tor?entry=computing_html_on_the_fly
    And I decided to try this.
    When I add the following in the JSP tab:
    <h:outputText binding="#{Page1.tableHtml}" id="outputText1"/>Save.
    Then click on the Design tab, then go back to the JSP tab, I now have:
    <h:outputText binding="#{Page1.tableHtml}" id="outputText1"/>
    <h:outputText binding="#{Page1.outputText1}" id="outputText1"/>It's late here, but this doesn't make any sense, why would switching between Design and JSP tabs add code?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Girish: I followed these steps:
    1.) Downloaded:
    Sun Java Studio Creator 2, Multilanguage creator-2-windows-ml.exe 254.23 MB
    2.) When I started the install, I received the message:
    Welcome to Sun Java(TM) Studio Creator 2! You are installing: Sun Java Studio Creator 2 development environment Sun Java System Application Server Platform Edition 8.1 2005Q1 Update Release 2 Bundled database
    3.) Installed version:
    Product Version: Java Studio Creator 2 (Build 060120)
    IDE Versioning: IDE/1 spec=5.9.1.1 impl=060120
    Also, Under, the Palette window: Standard component list, there is a component labeled Output Text.
    When placed on a jsp, the following code is produced:
    <h:outputText binding="#{Page1.outputText1}" id="outputText1" style="position: absolute; left: 24px; top: 48px"/>Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Add code snippets iBooks author

    How can I add code snippets to an iBooks author project?
    Is there a way to format a piece of text so that it would recognize Objective-C language?
    Or is there a way to insert a code snippet in some sort of box that will make it stand out from the rest of the text?

    ...is there a way to insert a code snippet in some sort of box that will make it stand out from the rest of the text?
    Have you tested the new pop-up widget?

  • [svn] 2847: add code coverage ability to asc build.xml ( clover jar and license required to run)

    Revision: 2847
    Author: [email protected]
    Date: 2008-08-14 15:06:10 -0700 (Thu, 14 Aug 2008)
    Log Message:
    add code coverage ability to asc build.xml (clover jar and license required to run)
    Modified Paths:
    flex/sdk/trunk/modules/asc/build/java/build.xml

    I ran into this same problem when using ProGuard 4.1 for Java obfuscation. The problem is that there is a space in the path to your JDK/JRE, for example: c:\Program Files\Java\jdk1.6.0_03. Because there is a space before the word "Files", it isn't working. The solution to to wrap quotes around that particular command-line argument. In ANT, I needed to use single-quotes (because double-quotes were already in use for the XML attribute) such as:
    <java jar="proguard.jar" fork="true" timeout="30000">
    <arg value="-libraryjars"/>
    <arg value="'${java.home}/lib/rt.jar'"/> <!-- Notice both double and single quotes used on this line. -->
    ...rest of the arguments go here...
    </java>
    Alternatively, using ProGuard's custom ANT Task, it would look something like (notice the use of double-quotes around the rt.jar location):
    <proguard>
    -libraryjars "${java.home}/lib/rt.jar"
    ...rest of the arguments go here...
    </proguard>
    Anyways, I hope this helps you or anyone else who runs into the same problem. Both of these approaches have worked for me.

  • Bug on native code of OJVM java.util.zip.CRC32.updateBytes(CRC32.java)

    I want to unzip OpenOffice 1.0 files inside the OJVM but it fails into the native method java.util.zip.CRC32.updateBytes(CRC32.java).
    The first execution of the code runs OK, but the second not.
    After a long wait it shutdown the connection and the oracle trace file shows an stack trace like this:
    *** 2003-04-18 11:31:31.926
    *** SESSION ID:(17.97) 2003-04-18 11:31:31.926
    java.lang.IllegalArgumentException
    at java.util.zip.CRC32.updateBytes(CRC32.java)
    at java.util.zip.CRC32.update(CRC32.java)
    at java.util.zip.ZipInputStream.read(ZipInputStream.java)
    at oracle.xml.parser.v2.XMLByteReader.fillByteBuffer(XMLByteReader.java:354)
    at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:142)
    at oracle.xml.parser.v2.XMLByteReader.saveBuffer(XMLByteReader.java:448)
    at oracle.xml.parser.v2.XMLReader.fillBuffer(XMLReader.java:2012)
    at oracle.xml.parser.v2.XMLReader.skipWhiteSpace(XMLReader.java:1800)
    at oracle.xml.parser.v2.NonValidatingParser.parseMisc(NonValidatingParser.java:305)
    at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:274)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:254)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:225)
    at com.prism.cms.frontend.EditPropertiesActions.processUpload(EditPropertiesActions.java:1901)
    Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x6d3a74a0, PC: [0x40263600, eomake_reference_to_eobjec
    t()+80]
    Registers:
    %eax: 0x54a54000 %ebx: 0x40429c20 %ecx: 0x54a546bf
    %edx: 0x6d3a7478 %edi: 0x402b27d0 %esi: 0x45c718ac
    %esp: 0xbfffbf20 %ebp: 0xbfffbf48 %eip: 0x40263600
    %efl: 0x00010206
    The code of the java method is:
    public static void processUpload(String id_page, String longname,
    String filename, String filetype,
    String s00)
    throws SQLException {
    Integer p_id = new Integer(id_page);
    String toSource;
    XMLDocument doc = null;
    DOMParser theParser = null;
    InputStream XSLStream = null;
    BufferedWriter out = null;
    #sql { select path||name||'.html' into :toSource from pages where id_page=:p_id };
    if ("Cancel".equalsIgnoreCase(s00)) {
    Jxtp.redirecUrl("/dbprism/ldoc/live/edit.html?p_source="+toSource);
    return;
    if ("no-file".equals(filename) && "no-contenttpye".equals(filetype)) {
    Jxtp.redirecUrl("/dbprism/ldoc/live/edit.html?p_source="+toSource);
    return;
    if ("xml".equalsIgnoreCase(filetype))
    #sql { call CMSj.moveFromUpload(:filename,:p_id) };
    else if ("sxw".equalsIgnoreCase(filetype)) {
    XSLProcessor processor = new XSLProcessor();
    XSLStylesheet theXSLStylesheet = null;
    BLOB locator = null;
    // open sxw file, it will be in zip format with a file named content.xml
    // then convert content.xml to document-v10.dtd with an stylesheet
    #sql { select blob_content into :locator from wpg_document where name = :filename for update };
    ZipInputStream zin = new ZipInputStream(locator.binaryStreamValue());
    ZipEntry entry;
    try {
    while((entry=zin.getNextEntry())!=null)
    if ("content.xml".equalsIgnoreCase(entry.getName())) {
    Integer newVersion;
    CLOB dstDoc;
    CMSDocURLStreamHandlerFactory.enableCMSDocURLs();
    try {
    URL inUrl = new URL("cms:/stylesheets/sxw2document-v10.xsl");
    XSLStream = inUrl.openStream();
    // Create the Stylesheet from the stream
    theXSLStylesheet = processor.newXSLStylesheet(XSLStream);
    // Stores the document processing it with the given stylesheet
    theParser = new DOMParser();
    theParser.setValidationMode(theParser.NONVALIDATING);
    theParser.setBaseURL(new URL("cms:/dtd/"));
    theParser.parse(zin);
    doc = theParser.getDocument();
    #sql { SELECT NVL(MAX(version),0)+1 INTO :newVersion FROM content
    WHERE cn_id_page = :p_id };
    #sql { INSERT INTO content( cn_id_page, version, owner, status, source_file,
    file_size, content, created, modified, created_by,
    modified_by)
    VALUES ( :p_id, :newVersion, sys_context('cms_context','user_id'),
    'Uploaded', :filename, 0 , EMPTY_CLOB(), SYSDATE, SYSDATE,
    sys_context('cms_context','user_id'),
    sys_context('cms_context','user_id')) };
    #sql { SELECT content INTO :dstDoc FROM content
    WHERE cn_id_page = :p_id AND version = :newVersion for update };
    #sql { call DBMS_LOB.trim(:inout dstDoc,0) };
    out = new BufferedWriter(dstDoc.getCharacterOutputStream(),dstDoc.getChunkSize());
    processor.processXSL(theXSLStylesheet, doc, new PrintWriter(out));
    #sql { delete from wpg_document where name=:filename };
    } catch (SAXParseException spe) {
    throw new SQLException("processUpload SAXParseException: "+xmlError(spe));
    } catch (SAXException se) {
    throw new SQLException("processUpload SAXException: "+se.getLocalizedMessage());
    } catch (XSLException xsle) {
    throw new SQLException("processUpload XSLException: "+xsle.getLocalizedMessage());
    } finally {
    if (XSLStream!=null)
    XSLStream.close();
    if (theParser!=null)
    theParser = null;
    if (out!=null) {
    out.flush();
    out.close();
    zin.close();
    } catch (IOException ioe) {
    throw new SQLException("processUpload IOException: "+ioe.getLocalizedMessage());
    } finally {
    if (XSLStream!=null)
    XSLStream = null;
    if (out!=null)
    out = null;
    if (zin!=null)
    zin = null;
    Jxtp.redirecUrl("/dbprism/ldoc/live/edit.html?p_source="+toSource);
    Basically it takes the content from a BLOB column of the wpg_document table, unzip it using java.util.zip package, look for the file content.xml and parse it using Oracle XML toolkit.
    Using an open source utility which replace java.util.package (http://jazzlib.sourceforge.net/) it works perfect because is a pure java application.
    Best regards, Marcelo.
    PD: I am using Oracle 9.2.0.2 on Linux.

    The cause of errors was a dying Westen Digital drive, specially the 48G partition reserved only for $ORACLE_BASE (/dev/sdb3 mounted on /opt/oracle).
    A simple quick scan of unmounted partition (badblocks -v /dev/sdb3) reported more than thousand new bad blocks (compared to the last scan six months ago). Although I strongly believe, specially in the case of WDC drives, that the best utility to "repair" bad blocks is the one that opens a window and prints the message: "Go to the nearest shop and buy a new drive", I was very curious to prove my suspicion just on this drive. After zero-filling the partition with dd, then formatting it (mke2fs -cc) and mounting again, the 11g installation and database creation (on the same partition) successfully completed, performing fast and smoothly. To make sure it was not a casual event, I repeated the installation once again with full success. The database itself is working fine (by now). Well, the whole procedure took me more than four hours, but I'm pretty satisfied. I learned once again - stay away from Western Digital. As Oracle cannot rely on dying drive, my friend is going tomorrow to spend a 150+ euro on two 250G Seagate Barracudas and replace both WDC drives, even though the first drive seems to be healthy.
    In general there is no difference between loading correct data from good disk into bad memory and loading the incorrect data from dying disk into good memory. In both cases the pattern is damaged. For everyone who runs into the problem similar to this, and the cause cannot be easily determined, the rule of thumb must be:
    1. test memory and, if it shows any error, check sockets and test memory modules individually
    2. check disks for bad blocks regardless of the result of memory testing
    Therefore I consider your answer being generally correct.
    Regards
    NJ

  • (error code = 200; message="Java error"; exception = [java.lang.Exception])

    Hi, I have several times tried to install ABAP Trial, but failed.
    So I need your help.
    As soon as I set up XP, I download and install the newest Java, then started installation of ABAP Trial.
    But at the end I just get an error message as belows.
    I hope you will guide me correct direction.
    Thanks for reading & Have a good day!
    (Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, An error occurred and product installation failed.  Look at the log file C:\SAP\NSP\log.txt for details.
    (Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
    STACK_TRACE: 15
    ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllInstallationSteps(StepWrapperInstallFiles.java:177)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.install(StepWrapperInstallFiles.java:268)
         at com.installshield.product.service.product.PureJavaProductServiceImpl.installProductAction(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.getResultForProductAction(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
         at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    (Jul 11, 2008 7:43:08 AM), Install, com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct, err, An error occurred and product uninstallation failed.  Look at the log file C:\SAP\NSP\log.txt for details.
    (Jul 11, 2008 7:43:08 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
    STACK_TRACE: 15
    ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllUninstallationSteps(StepWrapperInstallFiles.java:192)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.uninstall(StepWrapperInstallFiles.java:313)
         at com.installshield.product.service.product.PureJavaProductServiceImpl.uninstallProductAction(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.processActionsFailed(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
         at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Hi YUN SEOK,
    I got the same error than you when I tried to install SAP NetWeaver ABAP Trial Version. 
    Could you help me in giving exactly the link you wrote.
    https://www.sdn.sap.com/irj
    Where is located exactly the answer ?
    I looked at this link but I did not find the answer.
    So could you give me exactly the location in this link ?
    Thanks in advance.
    STD,

  • How and where to add code to login page

    I have a login page which uses the Dreamweaver Login Behavior.  I want to add code to:
         Check the status of the person loging in (status is the last field in the mySQL authentication table).
              a.     If the person is already logged in, display an error message, and reject the attempt.
              b.     If the person is NOT currently logged in, set his status accordingly, and log him in.
    Since the behavior is generated code, and well above my head, I don't know what code to enter, and where to enter it.  Here's the code for the form:
    <?php require_once('Connections/login.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "WOTCPg1.php";
      $MM_redirectLoginFailed = "loginerror.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_login, $login);
      $LoginRS__query=sprintf("SELECT UserID, Password FROM authentication WHERE UserID=%s AND Password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $login) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;      
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript">
    function setFocus()
    document.getElementById("username").focus();
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Log-in to IOD</title>
    <style type="text/css">
    <!--
    #apDiv3 {
    position:absolute;
    left:5px;
    top:101px;
    width:760px;
    height:612px;
    z-index:2;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: center;
    background-image: url(images/grid_gray.gif);
    border: medium ridge #009;
    #apDiv1 {
    position:absolute;
    left:94px;
    top:227px;
    width:629px;
    height:282px;
    z-index:3;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: center;
    #apDiv2 {
    position:absolute;
    left:178px;
    top:248px;
    width:564px;
    height:254px;
    z-index:3;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: left;
    border: medium groove #036;
    #apDiv4 {
    position:absolute;
    left:178px;
    top:245px;
    width:566px;
    height:242px;
    z-index:3;
    border: medium groove #009;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: capitalize;
    color: #009;
    .SubmitButton {
    color: #009;
    -->
    </style>
    </head>
    <body onLoad="setFocus()" >
    <span style="position:absolute; left:3px; top:2px; width:758; height:89;"><img src="sitebuilder/preview/sitebuilder/clipart/bars/regular/horizontal/sleekLines_blue.gif" width="760" height="90" alt="" /></span>
    <div id="e2" style="position:absolute; left:13px; top:14px; width:670px; height:32;"><span class="text"><b><span style="font-size: 22px"><font color="#FFFFFF">Sign-in to Information On Demand</font></span><font color="#FFFFFF" size="4"><span style="font-size:22px;line-height:26px;"><br soft="soft" />
    </span></font></b></span></div>
    <div id="apDiv3">
      <p><span style="text-align: center; text-decoration: underline; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 18pt; font-family: Arial, Helvetica, sans-serif;">Customer Sign-In</span><span style="position:absolute; left:12px; top:23px; width:151px; height:65;"><img src="sitebuilder/images/redInfoOnDemandLogo-150x65.jpg" width="149" height="65" alt="" /></span></p>
    </div>
    <div id="apDiv4">
    <form ACTION="<?php echo $loginFormAction; ?>" id="login" name="login" method="POST">
        <p>     </p>
        <p>User Name:<br /><input name="username" type="text" id="username" tabindex="1" size="30" maxlength="30" />
        </p>
        <p>User's Password:<br />
          <input type="password" name="password" id="password" tabindex="2" />
        </p>
        <p>
          <input name="submit" type="submit" class="SubmitButton" id="submit" tabindex="3" style="color:#009; font-weight:bold" value="Sign-in" />
       <input type="reset" name="reset" id="reset" value="Reset" tabindex="4" style="color:#009; font-weight:bold">
        </p>
      </form>
    </div>
    <br />
    </div>
    </body>
    </html>
    Here's the code for the script "included" in the first line of the page:
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_login = "localhost";  // Change to "mysql" when uploaded to Yahoo
    $database_login = "infoondemand";
    $username_login = "root";   // Change to "creacontech" when uploaded to Yahoo
    $password_login = "raisin4312";
    $login = mysql_pconnect($hostname_login, $username_login, $password_login) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>
    Could someone help me with this?  I'd very much appreciate any assistance.

    I should have warned you ealier that I don't know PHP very well, but if I can help nail down the process then hopefully one of the PHP experts can jump in.
    I'm still a little fuzzy on what is going on.  If Susie and Rodunda both have their own UserIDs and Passwords, then they can both be logged in at the same time, insert records til their hearts content and there will be abolutely no confict at all. The only issue here that may present a problem is if one of them attameps to update a record while the other one is looking at it, or getting ready to make their own modifications.
    Also, if Susie and Rodunda have their own user accounts with their own credentials, how is it that one would try to log in using the others' credentials?
    At any rate, and hopefully to get closer to a solutions for you, When a user is successfully authenticated, the session variable MM_Username is created.  So, simpy by checking for the existence of this session variable can tell you if that use is logged in or not.  This check can be placed before any of the login script so that it doesn't interfere with the behavior generated code. And you can choose what to do depending on the condition that exists - such as redirecting immediately to another page, or displaying or hiding a certain region on the page.
    Keep in mind that when the page first loads, thel login code is placed in an IF statement that checks the form action, so at first it's ignored and loads the form.  When the form is submitted, the IF conditino is met and the code executes.  To update the database with a "Logged in or out" value, you first have to place a recordset just after the IF statement that checks the form action, wirte another IF statement to check the value of the field, and then redirect to a logout page or continue with the login.
    If you continue with the login, you'll need an Update statement to change the field in the database just before the successful redirect.  If you've redirected to a log out page, you'll also need s similar update statement there.
    To write the recordset code, you can use DW's wizard and just move the code to where it needs to go. But the DW's update code depend on predeifned recordsets and form actions, so you'll need to find a script or hand code it, I wouldn't recommend trying to use DW's code and then modify it.
    So, what do you think, are we getting closer?

  • [svn] 4804: Bugs: LCDS-548: add code to deal with contentType="application/ xml" with one parameter (avoid

    Revision: 4804
    Author: [email protected]
    Date: 2009-02-02 17:56:22 -0800 (Mon, 02 Feb 2009)
    Log Message:
    Bugs: LCDS-548: add code to deal with contentType="application/xml" with one parameter (avoid
    name/value encoding in that case)
    LCDS-405: baseURL on HTTPMultiService should accept URLs which start with "/"
    Added convertParametersHandler and convertResultsHandler function hooks to RemoteObject
    to support framework code which wants to modify the service behavior.
    Moved "properties" from rpc/http/AbstractOperation to rpc/AbstractOperation so we can use
    it for customizing the handling of remote object results
    Couple of minor ASDoc fixes and one tab -> spaces change
    Doc: minor asdoc edits
    QE: LCDS QE will verify the bugs in this one
    Reviewers: Mete, Pete, Seth, Ed reviewed different parts of this checkin
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-548
    http://bugs.adobe.com/jira/browse/LCDS-405
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractOperation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/RemoteObject.as

    Hello,
    How about this as an alternative:
    Use a functional global which has 3 cases:
    1. open config file - it opens the config file and reads the contents into a string (which is the functional global data), and you only do this one time at the beginning of the program.
    2. edit config data - it edits the string, which are really the contents of the file, but doesn't worry about writing to the file.  you could even get fancy here, and allow an array of tags and an array of values as input, and it would go update/edit all the tags to have the corresponding values.
    3.  close config file - it writes the current string data (the functional global data) to the file and closes it.
    Using the functions in the string palette, I think you'll find most of the code for that module/functional global will be easy to write.
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • [svn:fx-trunk] 16349: Fix special case compc code in Library.java

    Revision: 16349
    Revision: 16349
    Author:   [email protected]
    Date:     2010-05-27 16:33:00 -0700 (Thu, 27 May 2010)
    Log Message:
    Fix special case compc code in Library.java
    Added support for special handling of include-classes and include-inheritance-dependencies-only in Library.
    QE notes: None
    Doc notes: None
    Bugs: SDK-26467,SDK-26464
    Reviewer: Paul
    Tests run: checkintests, mustella cyclone
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-26467
        http://bugs.adobe.com/jira/browse/SDK-26464
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/Library.java

  • Is it possible to make a code editor in Java?

    I'm new to java and so i'd like to know if it would be possible to make a simple code editor for Mobile Phones with Java.
    The code editor will be for GML.
    I'd like to make it so that the code can be easily edited on a wide range Mobile phones (not necissarily smart phones).
    If this is possible, I would greatly appreaciate any help or advice. Thanks.
    skinnyeddy

    TuringPest wrote:
    Hippolyte wrote:
    skinnyeddy wrote:
    "first list the areas in which you are proficient" - I'm not. I thought it would be easy to make a simple text/code editor in java without any experience. That was a bit of a mistake. Looks like I'll have to learn the hard way :SIMHO, one should woodshed it, work on programming basics and object-oriented programming fundamentals, in Java for at least one year before attempting to write any GUI code. Even day in this forum we see what code looks like when this advice is not followed.my first java code 5 years ago was an applet with a changing 2d function being animated.
    it worked after 2 grueling days and i was so happy because visual feedback was my only motivation.
    so its hard to say. granted, my code was awful for a long time.I'm thinking of the guy last week who had Swing+JDBC code and kept pestering for help on an obvious syntax error (he was invoking a method with no arguments when it was defined to take a String array) and for the life of him, he couldn't see the error or understand the error message. Posters kept telling him to learn the fundamentals first, but he was stubborn and kept demanding someone fix his syntax error...

Maybe you are looking for

  • Output quicktime movie choppy and less sharp than original

    Goodmorning! I am planning to make a stand alone movie of my footage that I can keep and watch on my iMac. My sequence was made on FCP 7 on 1920 x 1080 with Prores 422 codec. I did a few tests with exporting to quicktime movie (standard settings), be

  • Output not coming right, if we give LIFNR in selection screen

    Hi, i have LIFNR in selection screen, when i execute my report without inserting value in it...output is proper coming, but when i insert value in LIFNR, report doesn't display any data... please check my code and guide me... TABLES : bsik,bkpf,bseg,

  • How to setup Finger print scanner on home button of iPhone 5?

    How to setup Finger print scanner on home button of iPhone 5?

  • Devices you are using to create PDFs?

    How long have you been creating PDF docs?  WHAT ANDROID device(s) have you used to do that? What other Forums have you joined? THANKS FOR YOR REPLIES. I just joined. No docs created yet. I am using a Kindle Fire!

  • Setting the status?

    Hi, in one of my module after we enter one record we save and print. when i print that particular record i want the status to be Acknowldeged. when i save the record the status should be 'sent to dept', but when i print the record status should chang