ConText Search Option - Need Help

Hi,
I am wondering if the freely available oracle s/w supports ConText search option. I am getting error notice when i tried to configure context search option by ctxctl command.
Please suggest me what to do to invoke conText search option.
Thanks,
Rajesh

It would be a stand alone program, when you enter a url into the input box and hit search it should load the url typed in , in frame 2. But if the "Use Proxy" check box is checked then it should include the proxy in each search.
This swf is pretty self explanitory - http://www.mediafire.com/?6e9kl90s23lcyb9

Similar Messages

  • Proof of Purchase - Win 7 upgrade option (need help)

    hi,
    I ordered a Win 7 on Lenovo win7 upgrade option site today, i`ve got an email with details of my order, but there is nothing about sending proof of purchase i read before that it`s nessesery but i didn`t get any  information about how to send this proof of purchase and where.
    In my email there is only information about order, my status,
    Order Status              Pending for Payment
    Payment Status         Pending for deduction
    Payment Date         NA
    and this:
    Your credit card will only be charged EUR 17.75 upon the release of the selected language of Windows 7. The price shown is inclusive of tax and shipping charges.
    An email will be sent to you upon successful payment.
    but my friend who had ordered his win 7 2 months earlier got different message:\
    Your credit card will only be charged EUR 17.75 upon the release of the selected language of Windows 7 or successful validation of your Proof of Purchase, whichever comes later. The price shown is inclusive of tax and shipping charges.
    An email will be sent to you upon successful payment.
    So, could somebody help me? why we have got different emails?
    Is Proof of purchase needed to get win7 or something changed?
    PS: sorry for my english...
    Lenovo Y550 15,6" P7450 4GB 320GB NV130GT-512MB

    gorzi, welcome to the forum,
    don't panic! On the underside of your sytem is a label, on it you will find your type - model number, serial number and date of manufacture. Lenovo know, through the model and s/n when your system was manufactured. I'll bet that your manufacture date starts with 09 followed by a number larger than 06. In other words; if it's after 09/06 you don't need to provide proof of purchase as the system wasn't built before the upgrade program started.
    Your credit card will be charged when they send the discs.
    Hope this helps
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Text index search issue -- need help

    Hi,
    We have created a text index using the below script. This is working fine and we are able to retrieve data when we do a search on this with 'contains' clause.
    CREATE INDEX ITEM_TXT_IDX ON ITEM
    (ITEM_NAME)
    INDEXTYPE IS CTXSYS.CONTEXT;However now the problem is we are not able to search with special characters.
    when we perform search with below query it doesnt retrieve any record. i guess when we search with special character using text index, it ignores the special characters and performs search
    SELECT * FROM item
    WHERE contains(item_name, 'AGREE NATURE BALANCED NRML LIQ 300 ML (#', 1) > 0 the below query retrieves record fine as it doesnt have any special character search.
    SELECT * FROM item
    WHERE contains(item_name, 'AGREE NATURE BALANCED NRML LIQ 300 ML', 1) > 0can anyone pls help?

    You need to escape the special characters by either putting \ in front of each special character or putting {} around each token containing special characters. That will cause the contains query to view them as ordinary characters instead of attributing special meaning to them. However, since, by default, they are not tokenized and indexed, they will be ignored and your search will find a string with those characters and a string without those characters. If you want to be able to search for the actual characters, then you need to set them as printjoins in a lexer and use that lexer as a parameter in your index creation. You can see what has been tokenized and indexed by selecting from the token_text column of the dr$your_index_name$i domain index table after index creation. Please see the demonstration below.
    SCOTT@orcl_11gR2> -- test environment:
    SCOTT@orcl_11gR2> CREATE TABLE item
      2    (item_name  VARCHAR2 (60))
      3  /
    Table created.
    SCOTT@orcl_11gR2> INSERT ALL
      2  INTO item (item_name) VALUES ('AGREE NATURE BALANCED NRML LIQ 300 ML (#')
      3  INTO item (item_name) VALUES ('AGREE NATURE BALANCED NRML LIQ 300 ML')
      4  INTO item (item_name) VALUES ('OTHER DATA')
      5  SELECT * FROM DUAL
      6  /
    3 rows created.
    SCOTT@orcl_11gR2> -- without printjoins:
    SCOTT@orcl_11gR2> CREATE INDEX ITEM_TXT_IDX
      2  ON ITEM (ITEM_NAME)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  /
    Index created.
    SCOTT@orcl_11gR2> SELECT token_text FROM dr$item_txt_idx$i
      2  /
    TOKEN_TEXT
    300
    AGREE
    BALANCED
    DATA
    LIQ
    ML
    NATURE
    NRML
    OTHER
    9 rows selected.
    SCOTT@orcl_11gR2> SELECT * FROM item
      2  WHERE  contains
      3             (item_name,
      4              'AGREE NATURE BALANCED NRML LIQ 300 ML \(\#',
      5              1) > 0
      6  /
    ITEM_NAME
    AGREE NATURE BALANCED NRML LIQ 300 ML (#
    AGREE NATURE BALANCED NRML LIQ 300 ML
    2 rows selected.
    SCOTT@orcl_11gR2> SELECT * FROM item
      2  WHERE  contains
      3             (item_name,
      4              'AGREE NATURE BALANCED NRML LIQ 300 ML {(#}',
      5              1) > 0
      6  /
    ITEM_NAME
    AGREE NATURE BALANCED NRML LIQ 300 ML (#
    AGREE NATURE BALANCED NRML LIQ 300 ML
    2 rows selected.
    SCOTT@orcl_11gR2> -- with printjoins:
    SCOTT@orcl_11gR2> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('item_lexer', 'BASIC_LEXER');
      3    CTX_DDL.SET_ATTRIBUTE ('item_lexer', 'PRINTJOINS', '(#');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> DROP INDEX item_txt_idx
      2  /
    Index dropped.
    SCOTT@orcl_11gR2> CREATE INDEX ITEM_TXT_IDX
      2  ON ITEM (ITEM_NAME)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS ('LEXER  item_lexer')
      5  /
    Index created.
    SCOTT@orcl_11gR2> SELECT token_text FROM dr$item_txt_idx$i
      2  /
    TOKEN_TEXT
    300
    AGREE
    BALANCED
    DATA
    LIQ
    ML
    NATURE
    NRML
    OTHER
    10 rows selected.
    SCOTT@orcl_11gR2> SELECT * FROM item
      2  WHERE  contains
      3             (item_name,
      4              'AGREE NATURE BALANCED NRML LIQ 300 ML \(\#',
      5              1) > 0
      6  /
    ITEM_NAME
    AGREE NATURE BALANCED NRML LIQ 300 ML (#
    1 row selected.
    SCOTT@orcl_11gR2> SELECT * FROM item
      2  WHERE  contains
      3             (item_name,
      4              'AGREE NATURE BALANCED NRML LIQ 300 ML {(#}',
      5              1) > 0
      6  /
    ITEM_NAME
    AGREE NATURE BALANCED NRML LIQ 300 ML (#
    1 row selected.
    SCOTT@orcl_11gR2>

  • Searching Problem, need help plz...

    Hi All,
    I have a problem. After created index my_doc_idx1, i’m searching a word on all document i stored but find nothing. Everytime i search there’s no rows selected.
    anybody help me please?
    I including my code.
    My documents are:
    1. doc1.html contain:
    “Oracle interMedia audio, document, image, and video is designed to manage Internet media content”
    2. doc2.html contain:
    “Oracle interMedia User’s Guide and Reference, Release 9.0.1”
    3. word1.doc contain:
    “Oracle application server.”
    4. oracletext.pdf contain:
    “Stages of Index Creation.”
    Oracle9i 9 realese 2, Windows XP
    Thanks,
    Robby
    set serveroutput on
    set echo on
    -- create table
    create table my_doc (
    id number,
    document ordsys.orddoc);
    INSERT INTO my_doc VALUES(1,ORDSYS.ORDDoc.init());
    INSERT INTO my_doc VALUES(2,ORDSYS.ORDDoc.init());
    INSERT INTO my_doc VALUES(3,ORDSYS.ORDDoc.init());
    INSERT INTO my_doc VALUES(4,ORDSYS.ORDDoc.init());
    COMMIT;
    -- create directory
    create or replace directory dir_doc as 'e:\projects'
    -- import data
    DECLARE
    obj ORDSYS.ORDDoc;
    ctx RAW(4000) := NULL;
    BEGIN
    SELECT document INTO obj FROM my_doc WHERE id = 1 FOR UPDATE;
    obj.setSource('file','DIR_DOC','doc1.html');
    obj.import(ctx,FALSE);
    UPDATE my_doc SET document = obj WHERE id = 1;
    COMMIT;
    SELECT document INTO obj FROM my_doc WHERE id = 2 FOR UPDATE;
    obj.setSource('file','DIR_DOC','doc2.html');
    obj.import(ctx,FALSE);
    UPDATE my_doc SET document = obj WHERE id = 2;
    COMMIT;
    SELECT document INTO obj FROM my_doc WHERE id = 3 FOR UPDATE;
    obj.setSource('file','DIR_DOC','word1.doc');
    obj.import(ctx,FALSE);
    UPDATE my_doc SET document = obj WHERE id = 3;
    COMMIT;
    SELECT document INTO obj FROM my_doc WHERE id = 4 FOR UPDATE;
    obj.setSource('file','DIR_DOC','oracletext.pdf');
    obj.import(ctx,FALSE);
    UPDATE my_doc SET document = obj WHERE id = 4;
    COMMIT;
    END;
    -- check properties
    DECLARE
    obj ORDSYS.ORDDoc;
    idnum INTEGER;
    ext VARCHAR2(5);
    dotpos INTEGER;
    mimetype VARCHAR2(50);
    fname VARCHAR2(50);
    ctx RAW(4000) := NULL;
    BEGIN
    fname:= '';
    DBMS_OUTPUT.PUT_LINE('----------------------------------------');
    FOR I IN 1..4 LOOP
    SELECT id, document INTO idnum, obj FROM my_doc
    WHERE id = I;
    fname := obj.getSourceName();
    dotpos := INSTR(fname, '.');
    IF dotpos != 0 THEN
    ext := LOWER(SUBSTR(fname, dotpos + 1));
    ext := LOWER(ext);
    mimetype := 'application/' || ext;
    IF ext = 'doc' THEN
    mimetype := 'application/msword';
    obj.setFormat('DOC');
    ELSIF ext = 'pdf' THEN
    mimetype := 'application/pdf';
    obj.setFormat('PDF');
    ELSIF ext = 'ppt' THEN
    mimetype := 'application/vnd.ms-powerpoint';
    obj.setFormat('PPT');
    ELSIF ext = 'txt' THEN
    obj.setFormat('TXT');
    END IF;
    obj.setMimetype(mimetype);
    END IF;
    DBMS_OUTPUT.PUT_LINE('Document ID: ' || idnum);
    IF TO_CHAR(DBMS_LOB.getLength (obj.getContent())) = 0 THEN
    DBMS_OUTPUT.PUT_LINE('Content is NULL.');
    DBMS_OUTPUT.PUT_LINE('No information available.');
    ELSIF TO_CHAR(DBMS_LOB.getLength (obj.getContent())) <> 0 THEN
    DBMS_OUTPUT.PUT_LINE('Document Source: ' || obj.getSource());
    DBMS_OUTPUT.PUT_LINE('Document Name: ' || obj.getSourceName());
    DBMS_OUTPUT.PUT_LINE('Document Type: ' || obj.getSourceType());
    DBMS_OUTPUT.PUT_LINE('Document Location: ' || obj.getSourceLocation());
    DBMS_OUTPUT.PUT_LINE('Document MIME Type: ' || obj.getMimeType());
    DBMS_OUTPUT.PUT_LINE('Document File Format: ' || obj.getFormat());
    DBMS_OUTPUT.PUT_LINE('BLOB Length: ' || TO_CHAR(DBMS_LOB.getLength (obj.getContent())));
    END IF;
    DBMS_OUTPUT.PUT_LINE('----------------------------------------');
    END LOOP;
    EXCEPTION
    END;
    -- create index
    create index my_doc_idx1
    on my_doc(document.comments)
    indextype is ctxsys.context;
    commit;
    alter index my_doc_idx1
    rebuild online
    parameters('sync memory 10m');
    -- searching
    select id from my_doc t
    where contains(t.document.comments,'oracle') > 0
    order by id;
    select id from my_doc t
    where contains(t.document.comments,'application server') > 0
    order by id;
    select id from my_doc t
    where contains(t.document.comments,'index creation') > 0
    order by id;

    Hi,
    Which is best depends on the type of application you are building and the nature of the docs. For simple use with pdf's and word docs I prefer to use bfile or blob which is why I mentioned it. No sense in overcomplicating it.
    My recommendation - look at the interMedia docs and determine if you need the advanced features it provides. I like the application a lot, but am a firm believer in not adding complexity if there is no benefit to be had. Unless you are just playing around with it to learn, I'd recommend matching your project requirements up with what best meets them and go whichever route that is.
    Thanks,
    Ron

  • Using In-Memory Database Cache option need help

    Hi,
    I need some help:
    I am using Oracle 10g Server Release 2
    For Clientele activilty I am using Oracle Client where the Application resides.
    For Better performance I want to use the In-Memory Database Cache option Times-Ten Database.
    Is it possible to do so where there is Oracle Database Server Relaease 2 and in the Client there is Times-Ten In-Memory Database Cache?
    Any help will be needful for me

    In-Memory Cache is a server-side cache. I can not see where there would be any value putting it on the client side though given the license cost per CPU core I am sure the entire Oracle sales force would gladly disagree with me.

  • So many cameras so many options, need help?

    So I don't know if this has been answered but I need a nice new/used DSLR camera. Im going to be using it 95% of the time for YouTube and 5% for photo. I would like it to be under $1000 but that sounds like a tough budget. I want a DSLR because all the YT channels I see that use them have the sharpest video quality I have seen.  I really want a sharp image when recording. I also need a DSLR because I also need photos. Photos that are good and sharp. So for doing YouTube what would you recommend? Also how much does the lens matter?

    The entire "Rebel" line are under $1000 for both a body and kit lens.  Any DSLR and lens combination will generally yield fairly impressive quality compared to a non-DSLR.  But each lens has a character and which lens is best depends on what you want.
    Lenses capable of low focal ratios can help draw attention to your subject by using selective focus... your intended subject is tack-sharp and yet the background is deliberately blurry.  Also low focal ratios lenses can naturally capture images in lower light because the lens collects more light when the shutter is open.  The trade-off is that as you decrease the focal ratio, the range of distances nearer and farther from the focused distance at which subjects will appear reasonably well-focused will be narrower -- but that's what helps you create a deliberately de-focused background.
    The lowest possible focal ratio is typically part of the lens name and is listed as a value of f/__._  such as f/1.8... or as a range f/__._-__._ such as f/3.5-5.6.    If listed as a range, the first number is the lowest possible focal ratio available when the lens is at it's widest angle (shortest focal length) and the second number is the lowest possible focal ratio available when the lens is at it's narrowest angle (longest focal length).  
    The "sharpness" of the iamge is largely dictated by the lens.
    Canon's newest bodies offer their new "STM" lenses which feature their stepper motor technology -- this will be of interest to you.  The stepper motors focus a bit faster than their traditional motor... but are almost completely silent.  Most cannot be heard by the built-in microphone on the camera when shooting video.   While they are faster to focus than the traditional motors, they aren't quite as fast as Canon's USM motors (which are also extremely quiet).  For better audio quality, you may want to consider a higher quality external mic -- such as one of the many Rode VideoMics available on the market.  
    If your goal is primarily to shoot video AND if you expect the camera to subject distance to change as you film, then you may seriously want to consider the Canon EOS 70D.  This has the best video focusing system on the market.  All other cameras have to perform "focus hunt" to track live video -- you can notice the camera hunting for correct focus distance when you watch a video.  The 70D has a unique and new focusing system and is not only faster to determine if an image is correctly focused... if focus adjustment is needed, the 70D knows if the focus is too close or too far (it knows which way to go) AND it knows how far to adjust focus.  It's quite a nice system.  The price of the 70D will break your $1000 budget.
    The currently marketd Rebel bodies include the T3 (the start of the entry bodies), the T3i (it was the high end Rebel almost 3 years ago) and the T5i (the current top of the Rebel line).  The 70D is a mid-range body... it's just above the Rebel line.
    Tim Campbell
    5D II, 5D III, 60Da

  • My bluetooth is stuck on searching. Need help on this issue?

    I have been facing issues with the Bluetooth on my iPhone 4. I recently upgraded to 6.1.2 and the bluetooth is stuck on searching and never shows up phones around. Can you please provide a solution or fix for this. I did restart the phone and resetting all the settings.

    It will not connect to other phones.  This has never been a feature of iphone.
    It will stop searhcing when you hit the home button or back out of the bluetooth screen.

  • Almost there; keyword search query need help

    I will want to eventually add more columns to search but
    wanted to get it working with story only for now. I think I am very
    close. I have a very simple form with a textfield and submit
    button. the search field has a binding Request.search variable
    assigned to it. My query works in the Recordset Dialog box, can
    enter a test value in simple mode and it works. I entered
    construction and get three stories containing construction.
    Main problem is that no matter what I search when testing
    through my browser using my pc's Inetpub/wwwroot I get all news
    stories. I can even type in a weird search word like zebra and
    still get all records.
    here is my simple form code
    <form id="form1" name="form1" method="get"
    action="keywordjimresults.asp">
    <input name="search" type="text" id="search"
    value="<%= Request("search") %>" />
    <br />
    <input type="submit" value="Search" />
    </form>
    Here is my results page code
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    Repeat1__numRows = 10
    Repeat1__index = 0
    rsKeyword_numRows = rsKeyword_numRows + Repeat1__numRows
    %>
    <!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>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table width="650" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td><form id="form1" name="form1" method="get"
    action="keywordjimresults.asp">
    <input name="search" type="text" id="search"
    value="<%= Request("search") %>" />
    <br />
    <input type="submit" value="Search" />
    </form> </td>
    <td rowspan="6"> </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    </table>
    </body>
    </html>
    THANK YOU Jim

    I don't see anything at the bottom.
    Suggest  that you open the blank file to the size that you want, and the resolution the same as that of the picture.
    Bring both of these into view - tile view is good
    Drag picture to blank file. Do not drag from the project bin for this purpose
    You could also open the picture, go to Select>all, then Edit>copy. This will put it on the clipboard. Then in your destination, go to Edit>paste
    Resizing can be done in several ways. The least complicated way, in my opinion, is to use the crop tool, where you can enter the width and height in inches, and the resolution as well. The aspect ratio of the original picture may not conform to what you want. For example, a 4x6" picture has to be cropped in order to arrive at 1x1" - something has to go.

  • I'm not able to do the DELETE and the SEARCH options on my list ( HELP!! )

    import java.io.*;
    public class StudentContactManager
    public static void main(String[] args) throws IOException
    char userSelection;
    final int maxStudents = 10;
    String [] Lname = new String [maxStudents];//LName= Last Name
    String [] FName= new String [maxStudents];//FName=First Name
    String [] En= new String [maxStudents];//En = Enrolment Number
    String [] PhoneNo= new String [maxStudents];
    int activeEntries = 0;
    boolean found = false;
    //================================
    System.out.println ( "1 - Initialise contact detail list" );
    System.out.println ( "2 - Display contact details list" );
    System.out.println ( "3 - Insert new entry into cotact detail list" );
    System.out.println ( "4 - Delete entry from contact detail list" );
    System.out.println ( "5 - Search cotact detail list" );
    System.out.println ( "Q - Quit" );
    System.out.print ( "Option : " );
    userSelection = Text.readChar ( "Enter option" );
    while ( userSelection != 'Q' & userSelection != 'q' )
    switch ( userSelection )
    case '1': activeEntries=0 ;
    break;
    case '2': if (activeEntries > 0)//IF contact detail list contains entries
    System.out.println("\tEnrolment Number\tFirst Name\tSecond Name\tTelephone Number");
    for (int i = 0; i<activeEntries; i ++)//FOR each stored contact
    {//DO
    System.out.println();
    System.out.println("\t"+En[i]+"\t"+"\t"+FName[i]+ Lname[i]+"\t"+"\t"+PhoneNo);//Display one/current contact detail
    }//END-FOR
    else
    {// ELSE
    System.out.println("Contact detail list empty");//Display �Contact detail list empty� message
    }//END-IF
    break;
    case '3': if(activeEntries<maxStudents)
    En[activeEntries]= Text.readString("Enter enrolment number");
    found = false;
    int i = 0;
    while ( !found && i < activeEntries)
    if (En[i].equals(En[activeEntries]) )
    found = true;
    else
    i++;
    }//end-if
    }//end-while
    if (found == false)
    FName[activeEntries]=Text.readString("Enter first name");
    Lname[activeEntries]=Text.readString("Enter last name");
    PhoneNo[activeEntries]=Text.readString("Enter telephone number");
    // Insert new contact details into contact detail list
    activeEntries++;
    else
    System.out.println("Enrolment number already exists");
    else
    System.out.println("Contact detail list full");
    break;
    case '4': Text.showMessage("Selected Option 4");
    break;
    case '5':Text.showMessage("Selected option 5");
    default: Text.showMessage("invalid selection, Please input a valid option");
    break;
    }//switch
    userSelection = Text.readChar ( "Enter option" );
    }//while
    System.exit(0);
    }//main
    }//StudentContactManager
    //===============================================================================
    I need help with case 4 and case 5...the search option should include while statement. and the 5th case is the delete option
    Thanks guys =).

    Please use the code tags when posting code (there is a button on the posting page for them). It would also help if you told us what you are trying to do, what error you are getting, and what you expect to get.
    If you are just asking us to write the code for you, then you are in the wrong place.

  • Search help without search option

    Hi
    I would like to know how can i implement a search help in which i
    dont need a search option in the search help window.
    It should just display the list of available entries .
    I already have a search help with a search option,i need to modify the same.
    Please let me know..
    Regards
    Leon

    Hi,
              You will have to write a Search Help Exit and attach the search help to the search profile of the ordered product
    Refer the link
    https://forums.sdn.sap.com/click.jspa?searchID=3614449&messageID=1933569
    Regards

  • SP2010 I need to set the include in search option switch on all document libraries to off across all site collections on the whole farm?

    SP2010 I need to set the include in search option switch on all document libraries to off across all site collections on the whole farm?
    Has anybody seen If this can be done programmatically any help would be gratefully welcomed thanks.

    i am not sure about the script, why not create crawl rule which will exclude the allitems.aspx from showing in the search results.
    Go to search service application, crawling section, click crawl rules to create a crawl rule to excludehttp://*allitems.aspx page.
    also check this:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f431dd0e-871b-4f9e-990e-8f3b7ca932a4/crawl-rule-exclusion-sharepoint-2013
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Need help with search function in my program

    Hello all, some of you may remeber me from my previous inventory programs. Well I am finally on my last one and I need to add a search option to the code. Here is the class that will contain that option.
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Inventory2 extends JFrame implements ActionListener {
    //Utility class for displaying the picture
    //If we are going to use a class/method/variable inside that class only, we declare it private in that class
    private class MyPanel extends JPanel {
    ImageIcon image = new ImageIcon("Sample.jpg");
    int width = image.getIconWidth();
    int height = image.getIconHeight();
    long angle = 30;
    public MyPanel(){
    super();
    public void paintComponent(Graphics g){
         super.paintComponent(g);
         Graphics2D g2d = (Graphics2D)g;
         g2d.rotate (Math.toRadians(angle), 60+width/2, 60+height/2);
         g2d.drawImage(image.getImage(), 60, 60, this);
         g2d.dispose();
    }//end class MyPanel
    int currentIndex; //Currently displayed Item
    Product[] supplies = new Product[4];
    JLabel name ;
    JLabel number;
    JLabel rating;
    JLabel quantity;
    JLabel price;
    JLabel fee;
    JLabel totalValue;
    JTextField nameField = new JTextField(20);
    JTextField numberField = new JTextField(20);
    JTextField ratingField = new JTextField(20);
    JTextField quantityField = new JTextField(20);
    JTextField priceField = new JTextField(20);
    JPanel display;
    JPanel displayHolder;
    JPanel panel;
    boolean locked = false; //Notice how I've used this flag to keep the interface clean
    public Inventory2() {
    makeTheDataItems();
    setSize(700, 500);
    setTitle("Inventory Program");
    //make the panels
    display = new JPanel();
    JPanel other = new JPanel();
    other.setLayout(new GridLayout(2, 1));
    JPanel picture = new MyPanel();
    JPanel buttons = new JPanel();
    JPanel centerPanel = new JPanel();
    displayHolder = new JPanel();
    display.setLayout(new GridLayout(7, 1));
    //other.setLayout(new GridLayout(1, 1));
    //make the labels
    name = new     JLabel("Name :");
    number = new JLabel("Number :");
    rating = new JLabel("Rating     :");
    quantity = new JLabel("Quantity :");
    price = new JLabel("Price     :");
    fee = new JLabel("Restocking Fee (5%) :");
    totalValue = new JLabel("Total Value :");
    //Use the utility method to make the buttons
    JButton first = makeButton("First");
    JButton next = makeButton("Next");
    JButton previous = makeButton("Previous");
    JButton last = makeButton("Last");
    JButton search = makeButton("Search");
    //Other buttons
    JButton add = makeButton("Add");
    JButton modify = makeButton("Modify");
    JButton delete = makeButton("Delete");
    JButton save = makeButton("Save");
    JButton exit = makeButton("Exit");
    //Add the labels to the display panel
    display.add(name);
    display.add(number);
    display.add(rating);
    display.add(quantity);
    display.add(price);
    display.add(fee);
    //add the buttons to the buttonPanel
    buttons.add(first);
    buttons.add(previous);
    buttons.add(next);
    buttons.add(last);
    buttons.add(search);
    //Add the picture panel and display to the centerPanel
    displayHolder.add(display);
    centerPanel.setLayout(new GridLayout(2, 1));
    centerPanel.add(picture);
    centerPanel.add(displayHolder);
    other.add(buttons);
    JPanel forAdd = new JPanel(); // add the other buttons to this panel
    forAdd.add(add);
    forAdd.add(modify);
    forAdd.add(delete);
    forAdd.add(save);
    forAdd.add(exit);
    other.add(forAdd);
    //Add the panels to the frame
    getContentPane().add(centerPanel, "Center");
    getContentPane().add(other, "South");
    this.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setVisible(true);
    private void makeTheDataItems () {
    Product p1 = new DVD("The one", 001, 200, 100, "The one");
    Product p2 = new DVD("Once upon a time in China V", 002, 500, 10000, "Once upon a time in China V");
    Product p3 = new DVD("Rat Race", 003, 100, 3000, "Rat Race");
    Product p4 = new DVD("The Man in the Iron Mask", 004, 3000, 9000, "The Man in the Iron Mask");
    supplies[0] = p1;
    supplies[1] = p2;
    supplies[2] = p3;
    supplies[3] = p4;
    //Utility method for creating and dressing buttons
    private JButton makeButton(String label) {
    JButton button = new JButton(label);
    button.setPreferredSize(new Dimension(100, 25));
    button.setActionCommand(label);
    button.addActionListener(this);
    return button;
    private void addItem() {
    panel = new JPanel();
    JPanel add = new JPanel();
    add.setLayout(new GridLayout(7, 2));
    JButton addIt = makeButton("Add Item");
    JLabel name = new JLabel("Name :");
    JLabel rating = new JLabel("Rating     :");
    JLabel quantity = new JLabel("Quantity :");
    JLabel price = new JLabel("Price     :");
    add.add(name); add.add(nameField);
    add.add(rating); add.add(ratingField);
    add.add(quantity); add.add(quantityField);
    add.add(price); add.add(priceField);
    panel.add(add);
    JPanel forAddIt = new JPanel();
    forAddIt.add(addIt);
    panel.add(forAddIt);
    displayHolder.remove(display);
    displayHolder.add(panel);
    //display = panel;
    this.setVisible(true);
    public static void main( String args[]) {
    new Inventory2().displayFirst(); //The main method should not have too much code
    } // end main method
    public void actionPerformed(ActionEvent event) {
      String command = event.getActionCommand(); //This retrieves the command that we set for the button
      //Always compare strings using the .equals method and not using ==
      if(command.equals("First")) {
       if(!locked) {
         displayFirst();
      else if(command.equals("Next")) {
       if(!locked) {
         displayNext();
      else if(command.equals("Previous")) {
       if(!locked) {
         displayPrevious();
      else if(command.equals("Last")) {
       if(!locked) {
         displayLast();
      else if(command.equals("Exit")) {
       this.dispose();
       System.exit(0);
      else if(command.equals("Add")) {
       if(!locked) {
         addItem();
         locked = true;
      else if(command.equals("Add Item")) {
       addItemToArray();
      else if(command.equals("Modify")) {
       if(!locked) {
         modify();
         locked = true;
      else if(command.equals("Update")) {
          if(!locked) {
         modifyItemInArray();
         locked = true;
      else if(command.equals("Delete")) {
       if(!locked) {
         DVD dvd = (DVD)supplies[currentIndex];
            int confirm = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete item "+dvd.getItemNumber());
                if(confirm == JOptionPane.YES_OPTION) {
          removeItemAt(currentIndex);
          displayFirst();
    private void modify() {
    DVD dvd = (DVD)supplies[currentIndex];
    panel = new JPanel();
    JPanel add = new JPanel();
    add.setLayout(new GridLayout(7, 2));
    JButton update = makeButton("Update");
    JLabel number = new JLabel("Number :");
    JLabel name = new JLabel("Name :");
    JLabel rating = new JLabel("Rating     :");
    JLabel quantity = new JLabel("Quantity :");
    JLabel price = new JLabel("Price     :");
    add.add(number);
    numberField.setText(""+dvd.getItemNumber()); numberField.setEditable(false); add.add(numberField);
    add.add(name);
    nameField.setText(dvd.getItemName()); add.add(nameField);
    ratingField.setText(dvd.getRating()); ratingField.setEditable(false);
    add.add(rating); add.add(ratingField);
    add.add(quantity);
    quantityField.setText(""+dvd.getStockQuantity());
    add.add(quantityField);
    add.add(price);
    add.add(priceField); priceField.setText(""+dvd.getItemPrice());
    panel.add(add);
    JPanel forAddIt = new JPanel();
    forAddIt.add(update);
    panel.add(forAddIt);
    displayHolder.remove(display);
    displayHolder.add(panel);
    //display = panel;
          this.setVisible(true);
    private void addItemToArray() {
    Product p = new DVD(nameField.getText(), supplies.length + 1, Long.parseLong(quantityField.getText()),
    Double.parseDouble(priceField.getText()), ratingField.getText());
    //Extend size of array by one first
    Product[] ps = new Product[supplies.length + 1];
    for(int i = 0; i < ps.length-1; i++) {
    ps[i] = supplies;
    ps[supplies.length] = p;
    supplies = ps;
    displayHolder.remove(panel);
    displayHolder.add(display);
    displayLast();
    this.setVisible(false);
    this.setVisible(true);
    //Utility method to ease the typing and reuse code
    //This method reduces the number of lines of our code
    private void displayItemAt(int index) {
    DVD product = (DVD)supplies[index];
    name.setText("Item Name: "+ product.getItemName());
    number.setText("Item Number: "+ product.getItemNumber());
    rating.setText("Rating: "+ product.getRating());
    quantity.setText("Quantity In Stock: "+ product.getStockQuantity());
    price.setText("Item Price: "+ product.getItemPrice());
    totalValue.setText("Total: " + product.calculateInventoryValue());
    fee.setText("Restocking Fee (5%) :"+product.calculateRestockFee());
    locked = false;
    this.repaint();
    this.setVisible(true);
    private void modifyItemInArray() {
    Product p = new DVD(nameField.getText(), supplies.length + 1, Long.parseLong(quantityField.getText()),
    Double.parseDouble(priceField.getText()), ratingField.getText());
    supplies[currentIndex] = p;
    displayHolder.remove(panel);
    displayHolder.add(display);
         displayItemAt(currentIndex);
    this.setVisible(false);
    this.setVisible(true);
    private void removeItemAt(int index) {
    Product[] temp = new Product[supplies.length-1];
    int counter = 0;
    for(int i = 0; i < supplies.length;i++) {
    if(i == index) { //skip the item to delete
    else {
         temp[counter++] = supplies[i];
    supplies = temp;
    public void displayFirst() {
    displayItemAt(0);
    currentIndex = 0;
    public void displayNext() {
    if(currentIndex == supplies.length-1) {
    displayFirst();
    currentIndex = 0;
    else {
    displayItemAt(currentIndex + 1);
    currentIndex++;
    public void displayPrevious() {
    if(currentIndex == 0) {
    displayLast();
    currentIndex = supplies.length-1;
    else {
    displayItemAt(currentIndex - 1);
    currentIndex--;
    public void displayLast() {
    displayItemAt(supplies.length-1);
    currentIndex = supplies.length-1;
    }//end class Inventory2
    I am not sure where to put it and how to set it up. If you guys need the other two classes let me know. Thanks in advanced.

    Here are the other two classes:
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class Product implements Comparable {
    String name;
    int number;
    long stockQuantity;
    double price;
    public Product() {
      name = "";
          number = 0;
          stockQuantity = 0L;
          price = 0.0;
    public Product(String name, int number, long stockQuantity, double price) {
      this.name = name;
          this.number = number;
          this.stockQuantity = stockQuantity;
          this.price = price;
         public void setItemName(String name) {
      this.name = name;
    public String getItemName() {
      return name;
    public void setItemNumber(int number) {
      this.number = number;
    public int getItemNumber() {
      return number;
    public void setStockQuantity(long quantity) {
      stockQuantity = quantity;
    public long getStockQuantity() {
      return stockQuantity;
    public void setItemPrice(double price) {
      this.price = price;
    public double getItemPrice() {
      return price;
    public double calculateInventoryValue() {
      return getItemPrice() * getStockQuantity();
    public int compareTo (Object o) {
      Product p = (Product)o;
      return name.compareTo(p.getItemName());
    public String toString() {
      return "Name :"+getItemName() + "\nNumber"+number+"\nPrice"+price+"\nQuantity"+stockQuantity + "\nValue :"+calculateInventoryValue();
    class DVD extends Product implements Comparable {
    private String rating;
    public DVD() {
      super(); //Call the constructor in Product
      rating = ""; //Add the additonal attribute
    public DVD(String name, int number, long stockQuantity, double price, String rating) {
      super(name, number, stockQuantity, price); //Call the constructor in Product
      this.rating = rating; //Add the additonal attribute
         public void setRating(String rating) {
      this.rating = rating;
    public String getRating() {
      return rating;
    public double calculateInventoryValue() {
      return getItemPrice() * getStockQuantity() + getItemPrice()*getStockQuantity()*0.05;
    public double calculateRestockFee() {
      return getItemPrice() * 0.05;
    public int compareTo (Object o) {
      Product p = (Product)o;
      return getItemName().compareTo(p.getItemName());
    public String toString() {
      return "Name :"+getItemName() + "\nNumber"+getItemNumber()+"\nPrice"+getItemPrice()+"\nQuantity"+getStockQuantity() +"\nRating :"+getRating()+"\nValue"+calculateInventoryValue();
    }You should be able to search through these items, and any other items that have been added to the program.

  • I Just updated my iPhone 4 tp 7.1 oS. I am unable to connet to any network. I keep getting the "searching" Np Service" messages on the top let corner of the screen. I also get a notice that say " "unable to load network list. I need help...

    I Just updated my iPhone 4 to 7.1 oS. I am unable to connet to any network. I keep getting the "searching" No Service" messages on the top let corner of the screen. I also get a notice that says " "Unable to load network list. I need help... How can one resolve this issue?

    No it's not stealing. They have an allowance that you can share with so many computers/devices. You'll have to authorize her computer to play/use anything bought on your acct. You can do this under the Store menu at top when iTunes is open on her computer.
    As far as getting it all on her computer....I think but I am not sure (because I don't use the feature) but I think if you turn on Home Sharing in iTunes it may copy the music to her computer. I don't know maybe it just streams it. If nothing else you can sign into your acct on her computer and download it all to her computer from the cloud. Not sure exactly how to go about that, I haven't had to do that yet. I wonder if once you authorize her computer and then set it up for automatic downloads (under Edit>Preferences>Store) if everything would download. Sorry I'm not much help on that.

  • I sync my iPad. Now everything is messed up playlists and music are gone. Weird stuff showed up. And now I can't find the option to delete or make new playlists. 6.1.2 is my newest version!! NEED HELP!!

    So I don't sync my iPad very often. My dad and I share a computer. And I decided to do it the other day. I am pretty sure I did it all correctly selecting music that I wanted not deleting playlists but it seems to be that they are gone. And music I didn't want has appeared. And now I don't have an option (with this new iOS 6.1.2) to make new playlists or edit music I don't want out.
    I know I need help figuring those two things out 1 how to make a play list. There isn't a "add" button anymore in that screen I have a "you have no playlist"with a button underneath that says "go to iTunes Store" why I would need the store for that, I do not know.
    Then in the songs, artists, albums sections where you used to be able to hit "edit" button to delete the music you have that you don't want. I don't seem to be able to do anything at all to get rid of the random music I have.
    I need help. I know my iPad fairly well but I am not super savvy with it either.

    Is there a "New" button at the top right of the Playlists section of Music?
    There is no Edit button to delete music, swipe sideways on the song to reveal the delete button. Tap and hold on the artwork in Artists and albums to reveal the (X) button to delete. Or connect the iPad back up to iTunes on the computer and check your sync settings for music to ensure you are syncing the right content.

  • After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.

    After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ

    Izit software or hardware? Confuse:(
    Only can use wifi now.
    Any way thanks guys for ur suggestion:) amishcake and simes

Maybe you are looking for

  • JDeveloper's compiled JSP location in a .war file

    When I choose to build a .war file in JDeveloper 10.1.2 that contains the .JSP files, it sticks the compiled jsps in WEB-INF/classes/.jsps. To get the app server to properly recognize the precompiled JSPs, they need to be located in the WEB-INF/class

  • Loading custom image formats

    Hello all. I am wanting to load a custom image format into my Java application, and am wondering how to do that. I have a few ideas to try but I figure if there is a site out there (or someone with the knowledge), there is no need for me to re-invent

  • The Itunes application could not open. An unknown error has occurred.(-50)

    Does anyone know what his means and what to do to fix it?

  • Explosion of spam on iCloud mail

    I am getting enormous amounts of spam on my mac.com account during the last few weeks. Today at 6pm the total is 13 already. I have been able to set junk mail rules in icloud mail so that most of then are caught, but I do not understand why Apple is

  • Is it possible to convert HTML to PDF without pagination?

    I have an HTML file that I'd like to convert to PDF. Ideally, I'd like the PDF to consist of one long page without being broken up into different pages. Is this at all possible? I also don't want to scale the image down too far as to make it unreadab