Search Class : UpdateForReplace

Hi,
I'm using TS 3.1f1.
I need to find and replace a word in a Sequence File, using the TestStand API.
I use the Search method (which returns a SearchResults object), and then I can get each SearchMatch object.
So I can find all occurrences of the word in the sequence file.
But the UpdateForReplace method doesn't seem to work... I have no error but nothing is replaced.
I think I'm doing something wrong but I don't know what.
Could you please explain me how to replace the string ?
Bruno

Hi Bruno,
I have an example for you.
In my example, I am limiting my search on the Locals in the MainSequence. I have a piece of text in Locals.Text. I also have a local called Locals.cow.
The search text is in the FileGlobals which is equal to "cow" and the replacement text is in the Locals and is equal to "Dog". As you can probably gather I am changing very occurrance of "cow" with "Dog". Hence the reason for putting the search variable any else but the Locals as this would have been changed as will.
What I have found out is the UpdateForReplace method doesn't actual replace the actual property, you have to use the PropertyObject methods to do this.
from the Help:
This method does not perform the actual replace operation itself. Use PropertyObject to edit the file or property before calling this method.
You will notice that my Local.cow doesn't actually get changed, I think I should be handling this differently.
Also you will note that I am only changing the runtime values. If you what to change the actual sequence file, you will have to change the static value or work from the PropertyObjectFile.
Hope this helps.
Regards
Ray Farmer
Regards
Ray Farmer
Attachments:
Sequence File1.seq ‏58 KB

Similar Messages

  • Using a content Search class

    The search class below works. When I try to pass the String array
    into a servlet using:
    Searcher search_instance = new Searcher();
    String[] servlet_array = search_instance.getRes();
    it always fails. When I configure the class as a stand-alone
    class (with the 'getRes' method called from a 'main' method. It
    works. Also, when I tried to convert this code into a servlet,
    it fails as well. I simply want to return search results to a
    browser using a servlet or JSP. Has anyone solved a similiar
    problem?
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.common.CleartextCredential;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.beans.DirectoryUser;
    import oracle.ifs.beans.PrimaryUserProfile;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.ContentObject;
    import oracle.ifs.beans.Search;
    import oracle.ifs.beans.SearchResultObject;
    import oracle.ifs.search.ContextSearchSpecification;
    import oracle.ifs.search.SearchClassSpecification;
    import oracle.ifs.search.SearchSortSpecification;
    import oracle.ifs.search.SearchClause;
    import oracle.ifs.search.SearchQualification;
    import oracle.ifs.search.JoinQualification;
    import oracle.ifs.search.FolderRestrictQualification;
    import oracle.ifs.search.AttributeQualification;
    import oracle.ifs.search.ContextQualification;
    import oracle.ifs.common.AttributeValue;
    public class Searcher extends Object {String[] results = new
    String[100];
    public String[] getRes(){
    try {
    LibraryService ifsService = LibraryService.startService
    ("ifsDefault", "ifssys");
    CleartextCredential cred = new CleartextCredential
    ("bill","bill");
    LibrarySession ifsSession = ifsService.connect(cred, null);
    DirectoryUser thisUser = ifsSession.getUser();
    String[] ctxClauseName = {"Test1"}; // order by SCORE
    // set DESCENDING sort order
    boolean [] sortOrders = {false};
    SearchSortSpecification sortSpec =
    new SearchSortSpecification(new String[] {"DOCUMENT"},
    new String[]
    {ContextQualification.ORDER_PREFIX + "." +
                                        ctxClauseName[0]},
    sortOrders);
    // create a query expression using interMedia Text query
    syntax
    String searchWord1 = "Clareos";
    String searchWord2 = "cart";
    String queryOperator = " & ";
    //String queryExpr = searchWord1 + queryOperator +
    searchWord2;
    String queryExpr = searchWord1 ;
    // create a ContextQualification and specify the query
    expression
    ContextQualification cq = new ContextQualification();
    cq.setQuery( "?" );
    cq.setName(ctxClauseName[0]);
    // now join with CONTENTOBJECT
    JoinQualification jq = new JoinQualification();
    jq.setLeftAttribute("DOCUMENT", "CONTENTOBJECT");
    jq.setRightAttribute("CONTENTOBJECT", null);
    SearchClause sc = new SearchClause( cq, jq,
    SearchClause.AND );
    ContextSearchSpecification cp = new
    ContextSearchSpecification();
    cp.setContextClassname("CONTENTOBJECT");
    cp.setSearchClassSpecification(new SearchClassSpecification
    (new String[]
    {"DOCUMENT", "CONTENTOBJECT"}));
    cp.setSearchQualification(sc);
    cp.setSearchSortSpecification(sortSpec);
    Search s = new Search(ifsSession, cp);
    AttributeValue[] bindValue = new AttributeValue[1];
    bindValue[0] = AttributeValue.newAttributeValue( queryExpr );
    int y=0;
    s.open(bindValue);
    while (y<results.length){
    results[y]= s.next().getLibraryObject().getName();
    System.out.println(results[y]);
    y++;
    s.close();ifsSession.disconnect();} catch (IfsException e){}
    return results;}
    }

    Hi,
    Please try to use the following query text.
    (CONTAINS(PlacesId, 'a2ce9dd7-f801-4403-affb-1944bf253255') OR (PlacesId > ''))
    Here are two materials for you to take a look at:
    http://blog.mastykarz.nl/excluding-empty-text-values-sharepoint-search/
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2ad1963f-f6e5-4c01-8826-444a6ba8de40/fulltextsqlquery-for-null-value?forum=sharepointdevelopmentprevious
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Usage if the ifs-search classes

    hi,
    I look for an example of the use of the search classes -- Oracle.ifs.search.*, Oracle.ifs.beans.Search and Oracle.ifs.beans.SearchResultObject.
    It would be nice if you could give me a small codeexample
    TIA
    Oliver

    * This method seaches and gets the content of an iFS document.
    private static String getStyleSheetContent(LibrarySession ifs, String xslName)
    throws IfsException
    String retString = "";
    String className[] = {"DOCUMENT"};
    SearchClassSpecification scs = new SearchClassSpecification(className);
    scs.addResultClass("DOCUMENT");
    AttributeQualification aq1 = new AttributeQualification();
    aq1.setAttribute("DOCUMENT", "NAME");
    aq1.setOperatorType(AttributeQualification.LIKE);
    aq1.setValue(xslName);
    SearchSortSpecification ss = new SearchSortSpecification();
    ss.add("NAME" , SearchSortSpecification.ASCENDING);
    AttributeSearchSpecification ass = new AttributeSearchSpecification();
    ass.setSearchClassSpecification(scs);
    ass.setSearchQualification(aq1);
    ass.setSearchSortSpecification(ss);
    Search srch = new Search(ifs, ass);
    srch.open();
    try
    { while (true)
    LibraryObject lo = srch.next().getLibraryObject();
    Document d = (Document)lo;
    InputStream is = d.getContentStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    for (String nextLine = br.readLine(); nextLine != null; nextLine = br.readLine())
    retString += nextLine;
    br.close();
    catch (IfsException e)
    if (e.getErrorCode() == ERRORCODE)
    if (DEBUG)
    System.out.println("Reached the end of the search data");
    else
    throw e;
    catch (IOException ioe)
    System.err.println("IOException reading XSL : " + ioe.toString());
    srch.close();
    if (DEBUG)
    System.out.println("Returning :[" + retString + "]");
    return retString;
    null

  • Search Class Lib

    Hi, all
    This is so stupid question.
    I have copy a Java File. when I want to compile, it give me an error.
    I have no org.apache.util.HttpURL package.
    which Jar includes it?
    Thanks

    You got that Java file from somebody else, right? Ask them what other jars you need to compile it.

  • Search for description containing non-English chars -- ?

    Hello!
    I've implemented a search class, which allows customers to search folders/documents by name, owner, description, etc.
    And here's the problem: if description contains non-English (Russian, in my case) characters, search does not work! Everything (AS infrastructure, CM SDK DB, etc) was installed using UTF-8 Unicode charset. When I debug the code, I see that when I build AttributeQualification and later compose a comples SearchQualification, value in these is correct, but when I call getSQL(), I see string like this:
    ... ( nls_upper(ALIASDOCUMENT.DESCRIPTION) LIKE nls_upper('????') ) ...
    So it seems as if SQL converted passed UNICODE value into ANSI string, and since server's system language is English, my Russian letters were lost -- ?
    Can anybody shed some light here? Is there a way to search for UNICODE descriptions (and content, for that matter)?
    Thanks,
    Sasha.

    Hi Sasha,
    I want you to try the following code. It should output the file description and query to a text file. Use internet explorer / or notepad to open this file and ****specify that the file encoding is UTF8.*****
    thanks,
    matt.
    java -classpath ...blah blah.. RussianSearch parameterfile=c\cmsdkparameters.txt
    cmsdkparameters.txt contains:
    Username = system
    Password = oracle9i
    SchemaPassword = cmsdk
    Domain = ifs://ifspm-sun2.us.oracle.com:1521:mjs92.us.oracle.com:cmsdk903
    ServiceConfiguration = SmallServiceConfiguration
    Service = TestService
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.ClassObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.DocumentDefinition;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.FolderDefinition;
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Search;
    import oracle.ifs.beans.SearchResultObject;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.CleartextCredential;
    import oracle.ifs.common.Credential;
    import oracle.ifs.common.ParameterTable;
    import oracle.ifs.search.AttributeQualification;
    import oracle.ifs.search.AttributeSearchSpecification;
    import oracle.ifs.search.SearchClassSpecification;
    import oracle.ifs.search.SearchSortSpecification;
    import java.io.FileOutputStream;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.util.Hashtable;
    import java.util.Vector;
    * Copyright (c) 2003 Oracle Corporation. All rights reserved.
    * Matt Shannon.
    * Description:
    *  Test searching in Russian Language
    *  View output file in notepad or IE - make sure to specify character
    *  set of document to be UTF8 when opening.
    public class RussianSearch implements Runnable
      // set to 'false' to prevent the class from freeing objects that it creates
      public static final boolean performCleanup = true;
      protected ParameterTable m_parametertable;
      private Vector m_ObjectsRequiringCleanup; 
      public RussianSearch(String[] args)
        // parameter file is retrieved through command line argument parameterfile=
        m_parametertable = new ParameterTable(args, "parameterfile");
      public static void main(String[] args)
        new Thread(new RussianSearch(args)).start();
       *   This is where you write your test program.
      public void run()
        LibraryService service = startService();
        LibrarySession session = establishSession(service);
        if (session == null)
          return;
        try
          DocumentDefinition ddef = new DocumentDefinition(session);
          ddef.setAttribute(PublicObject.NAME_ATTRIBUTE,
            AttributeValue.newAttributeValue("blah.txt"));
          ddef.setAttribute(PublicObject.DESCRIPTION_ATTRIBUTE,
            AttributeValue.newAttributeValue("&#1071; &#1089;&#1082;&#1091;&#1095;&#1072;&#1102; &#1087;&#1086; &#1088;&#1086;&#1076;&#1080;&#1085;&#1077;"));
          ddef.setEmptyContent();
          Document newdoc = (Document) session.createPublicObject(ddef);
          addObjectRequiringCleanup(newdoc);
          /*  Construct AttributeSearchSpecification.
           *  Attribute based conditions are allowed, context conditions are not!
          AttributeSearchSpecification attrSrchSpec =
            new AttributeSearchSpecification();
          /*  Construct SearchClassSpecification.
           *  This represents the FROM and SELECT clauses of the query.
          SearchClassSpecification srchClsSpec = new SearchClassSpecification();
          srchClsSpec.addSearchClass(Document.CLASS_NAME);      // from clause
          srchClsSpec.addResultClass(Document.CLASS_NAME);      // select clause
          /*  Construct SearchSortSpecification.
           *  This represents the ORDER BY clause of the query.
          SearchSortSpecification srchSortSpec = new SearchSortSpecification();
          //  upper case ascending sort on Name
          srchSortSpec.add(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE,
            SearchSortSpecification.ASCENDING, "nls_upper");
          /*  AttributeQualification is a WHERE clause component representing an
           *  attribute condition.
          // scalar AttributeQualification - name like '%.html'
          AttributeQualification aq = new AttributeQualification();
          aq.setAttribute(Document.CLASS_NAME, PublicObject.DESCRIPTION_ATTRIBUTE);
          aq.setOperatorType(AttributeQualification.LIKE);
          aq.setValue("%&#1088;&#1086;&#1076;&#1080;&#1085;&#1077;");
          // set SELECT & FROM clauses
          attrSrchSpec.setSearchClassSpecification(srchClsSpec);
          // set ORDER BY clause
          attrSrchSpec.setSearchSortSpecification(srchSortSpec);
           // set WHERE clause
          attrSrchSpec.setSearchQualification(aq);
          /* Construct Search, supply SearchSpecification */
          Search s = new Search(session,attrSrchSpec);
          System.out.println("File encoding system property: "+System.getProperty("file.encoding"));
          boolean append = false;
          FileOutputStream fos = new FileOutputStream("c:/test.txt",append);
          OutputStreamWriter osw = new OutputStreamWriter(fos);
          System.out.println("Default character encoding: "+osw.getEncoding());
          osw = new OutputStreamWriter(fos,"UTF8");
          System.out.println("New character encoding: "+osw.getEncoding());
          PrintWriter out = new PrintWriter(osw,true);
          out.println(s.getSQL());
          SearchResultObject obj = null;
          // Open Search!
          s.open();
          try
             * A SearchResultObject encapsulates a row of a search result.  It
             * contains 1 or more LibraryObjects (depending on number of result
             * classes specified).
            while ( (obj = s.next()) != null )
              Document d = (Document)(obj.getLibraryObject(Document.CLASS_NAME));
              out.println(d.getName() + " " + d.getDescription());
          catch (Throwable e)
            if  ((e instanceof IfsException) &&
              (((IfsException)e).containsErrorCode(22000)))
            else
              System.out.println("Unexpected exception occurred in selector cursor");
              System.out.println((e instanceof IfsException)
                ? ((IfsException)e).toLocalizedString()
                : e.toString());
          finally
            out.close();
            if (performCleanup)
              cleanup();
            s.close();
            s.dispose();
        catch (Throwable e)
          System.out.println("Fatal exception occurred in run():");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        finally
          disconnectSession(session);
      public LibraryService startService()
        String schemapassword = m_parametertable.getString("SchemaPassword");
        String domain = m_parametertable.getString("Domain");
        String servicename = m_parametertable.getString("Service",domain);
        String serviceconfiguration =
          m_parametertable.getString(
            "ServiceConfiguration","SmallServiceConfiguration"
        LibraryService service = null;
        try
          if (servicename != null &&
            LibraryService.isServiceStarted(servicename))
            // The service name was specified, and is already running.
            // So just use it.
            System.out.println("Service already running: "+servicename);
            service = LibraryService.findService(servicename);
            System.out.println("Existing service retrieved");
          else
            service = LibraryService.startService(
              servicename, schemapassword, serviceconfiguration, domain);
            System.out.println("Service started: '"+servicename+
              "' (version: "+service.getVersionString()+")");
        catch (Throwable e)
          System.out.println("Unable to start service:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return service;
      public LibrarySession establishSession(LibraryService service)
        String username = m_parametertable.getString("Username");
        String password = m_parametertable.getString("Password");
        return establishSession(service, username, password);
      public LibrarySession establishSession
        LibraryService service,
        String username,
        String password
        LibrarySession session = null;
        try
          CleartextCredential cred = new CleartextCredential(username,
            password);
          session = establishSession(service, cred);
        catch (Throwable e)
          System.out.println("Unable to create credential:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return session;
      public LibrarySession establishSession
        LibraryService service,
        Credential cred
        LibrarySession session = null;
        if (service != null)
          try
            String username = cred.getName();
            session = service.connect(cred, null);
            System.out.println("Session established for " + username);
          catch (Throwable e)
            System.out.println("Unable to create session:");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
        return session;
      public void disconnectSession(LibrarySession session)
        System.out.println("Disconnecting session");
        try
          session.disconnect();
        catch (Throwable e)
          System.out.println("Error disconnecting session:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
      public void addObjectRequiringCleanup(LibraryObject lo)
        Vector v = getObjectsRequiringCleanupVector();
        v.addElement(lo);
      private Vector getObjectsRequiringCleanupVector()
        if (m_ObjectsRequiringCleanup == null)
          m_ObjectsRequiringCleanup = new Vector();
        return m_ObjectsRequiringCleanup;
       * Frees objects that were marked as requiring clean up
      public void cleanup()
        Vector v = getObjectsRequiringCleanupVector();
        System.out.println("Cleanup - delete objects created during the session");
        int count = (v == null) ? 0 : v.size();
        System.out.println("# of objects to free: "+count);
        // Free the objects in reverse order from which they were added
        for (int i = count - 1; i >= 0; i--)
          LibraryObject lo = (LibraryObject)v.elementAt(i);
          try
            discardObject(lo);
          catch (Exception e)
            System.out.println("Unable to discard an object during cleanup - continuing...");
      public void discardObject(LibraryObject lo) throws IfsException
        if (lo != null)
          try
            System.out.println("Attempting to free: "+getDisplayName(lo));
            LibrarySession session = lo.getSession();
            if (lo instanceof Folder)
              System.out.println("Attempting to free Folder with Deep Option!");
              // free Folder using "Deep" option to free
              // all items in the folder, and all of their items, etc.
              Folder folder = (Folder)lo;
              FolderDefinition def = new FolderDefinition(session);
              def.setFolderDepthOption(
                Folder.SYSTEMOPTIONVALUE_FOLDER_DEPTH_DEEPEST);
              folder.free(def); // removes object from the repository, with options
            else
              // just a regular free
              lo.free();
          catch (Exception e)
            System.out.println("Unable to free an object during cleanup - continuing");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
      public String getDisplayName(LibraryObject lo)
        throws IfsException
        String displayName;
        if (lo != null)
          displayName = lo.getClassObject().getName()
            + " '" + lo.getName() + "'";
        else
          displayName = "<null object>";
        return displayName;
    }

  • IFS Custom Attribute Search .. can't get to work

    Here is a code snipet off a simple attribute search against the VCARDSTREETADDRESS content class.. I can't for the life of me get it to return any results. Looking in the VCARDSTREETADDRESS table I am sure there is a City = Charlotte.. What am I doing wrong?
    // Join the ContentObject and Document Tables
    JoinQualification joinQualification = new JoinQualification();
    joinQualification.setLeftAttribute("DOCUMENT", "CONTENTOBJECT");
    joinQualification.setRightAttribute("CONTENTOBJECT", null);
    // Search the root folder and descendants.
    oracle.ifs.beans.Folder searchFolderObject = null;
    searchFolderObject = libSession.getRootFolder();
    FolderRestrictQualification folderRestrictQualification = new FolderRestrictQualification();
    folderRestrictQualification.setStartFolder(searchFolderObject);
    // Here is my attribute search
    SearchClause searchClause = new SearchClause(joinQualification, folderRestrictQualification, SearchClause.AND);
    AttributeQualification attributeQualification = new AttributeQualification();
    attributeQualification.setAttribute("VCARDSTREETADDRESS","CITY");
    attributeQualification.setOperatorType("LIKE");
    attributeQualification.setValue("C%");
    searchClause = new SearchClause(searchClause,attributeQualification, searchClause.AND);
    // Set the attribute search class
    AttributeSearchSpecification attribSearchSpecification = new AttributeSearchSpecification();
    String[] searchClasses = {"DOCUMENT","CONTENTOBJECT", "VCARDSTREETADDRESS"};
    SearchClassSpecification searchClassSpecification = new SearchClassSpecification(searchClasses);
    searchClassSpecification.addResultClass("VCARDSTREETADDRESS");
    attribSearchSpecification.setSearchClassSpecification(searchClassSpecification);
    attribSearchSpecification.setSearchQualification(searchClause);
    Search attributeSearch = new Search(libSession, attribSearchSpecification);
    attributeSearch.open();
    SearchResultObject[] sro = attributeSearch.getItems();
    // Returns null ... have many documents in the VCARDSTREETADDRESS class
    // with a city of 'Charlotte'.

    Thanks for your help. I tried going back and simplifying the query so that it was just and attribute qualification and now my query returns every object in the system. The API docs obviously need some help since they even reference deprecated methods :
    // Set the WHERE clause of the Search
    asp.setSearchQualifier(someSearchQual);
    Anyways here my latest code:
    public class QueryTester {
    protected AttributeQualification getAttributeSearchClause() throws IfsException{
    try {
    AttributeQualification attributeQualification = new AttributeQualification();
    attributeQualification.setAttribute("VCARDSTREETADDRESS","CITY");
    attributeQualification.setOperatorType(AttributeQualification.LIKE);
    attributeQualification.setValue("C%");
    return attributeQualification;
    catch (RuntimeException ex) {
    String exceptionText = "RuntimeException in getAttributeSearchClause(). Nested Exception:" + ex;
    System.out.println (exceptionText);
    throw ex;
    catch (IfsException ex) {
    String exceptionText = "IfsException in getAttributeSearchClause(). Nested Exception:" + ex;
    System.out.println (exceptionText);
    throw ex;
    protected SearchClassSpecification getSearchClassSpecification() throws IfsException {
    try {
    String[] searchClasses = {"VCARDSTREETADDRESS","DOCUMENT"};
    SearchClassSpecification searchClassSpecification = new SearchClassSpecification(searchClasses);
    searchClassSpecification.addResultClass("DOCUMENT");
    //searchClassSpecification.addResultClass("VCARDSTREETADDRESS");
    return searchClassSpecification;
    catch (IfsException ex) {
    String exceptionText = "Error in getSearchClassSpecification : " + ex;
    System.out.println (exceptionText);
    throw ex;
    public static void main (String[] args) {
    try {
    QueryTester qt = new QueryTester();
    System.out.println ("Logging in.");
    IfsFileSystem IfsAPI = new IfsFileSystem("cvars", "cvars", "docrunner", "ifssys");
    System.out.println ("Logged on successfully.");
    LibrarySession libSession = IfsAPI.getLibrarySession();
    AttributeQualification aq = qt.getAttributeSearchClause();
    AttributeSearchSpecification attribSearchSpecification = new AttributeSearchSpecification();
    attribSearchSpecification.setSearchClassSpecification(qt.getSearchClassSpecification());
    attribSearchSpecification.setSearchQualification(aq);
    System.out.println ("Perfoming Search...");
    Search attributeSearch = new Search(libSession, attribSearchSpecification);
    attributeSearch.open();
    SearchResultObject[] sro = attributeSearch.getItems();
    if (sro!=null)
    System.out.println ("Results : " + sro.length);
    libSession.disconnect();
    catch (IfsException ifsex) { System.out.println ("IfsException : " + ifsex); }
    catch (RuntimeException rux) { System.out.println ("RuntimeExcpetion : " + rux); }
    BTW. VCARDSTREETADDRESS comes from the IFS example (Developers Guide) and its XML. <Superclass Reftype ="name">Document</Superclass>
    So it is inherited from Document. But if you don't put Document you get an IFSException that says you must include Document in the searchClass. I guess I could use the 'Selector' model but this doen't seem particularlly elegant or as flexible.
    String search = PublicObject.NAME_ATTRIBUTE
    + "= '" + name +"'";
    Selector mySelector = new Selector (ifsSession, Document.CLASS_NAME, search);
    null

  • Missing class indicator field from database row

    Hi,
    I have following problem :
    There is a class inheritance with root interface and 4 subclasses, they are initialized with class indicator field. If I use ReadAllQuery with an interface or some of concrete class as search class - it is working perfect, but if I try to build query with custom selected fields (addPartialAttribute) I always get an error - Missing class indicator field from database row.
    AFAIK This field have not to be mapped in Workbench to real table column, how can I tell TopLink that I will read this indicator field too by reading some custom fields ? I thought TopLink reads such fields automatically, like it does it with primary keys.
    Thank you
    Maksim

    This sounds like an issue with our partial attribute queries and inheritance as the type indicator column must always be read. Can you map the type indicator to a read-only attribute (mark mapping as read-only) and include this in your list of attributes as a work-around?
    Doug

  • Search Box is not showing in custom master page

    Hi 
    I am using "Office 365 Enterprise E3 Trial"
    and have created a custom master page for my public SharePoint
    site .
    I have added Search snippet from the snippet gallery but the search
    box is not showing in the master page .I am not able to find the reasons .

    My Master page code is like bellow
    <!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" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=10" xmlns="" />
            <!--CS: Start Page Head Contents Snippet-->
            <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SID:00 -->
            <meta name="GENERATOR" content="Microsoft SharePoint" xmlns="" />
            <meta http-equiv="Content-type" content="text/html; charset=utf-8" xmlns="" />
            <meta http-equiv="Expires" content="0" xmlns="" />
            <!--MS:<SharePoint:RobotsMetaTag runat="server">-->
            <!--ME:</SharePoint:RobotsMetaTag>-->
            <!--MS:<SharePoint:PageTitle runat="server">-->
                <!--MS:<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server">-->
                    <!--MS:<SharePoint:ProjectProperty Property="Title" runat="server">-->
                    <!--ME:</SharePoint:ProjectProperty>-->
                <!--ME:</asp:ContentPlaceHolder>-->
            <!--ME:</SharePoint:PageTitle>-->
            <!--MS:<SharePoint:StartScript runat="server">-->
            <!--ME:</SharePoint:StartScript>-->
            <!--MS:<SharePoint:CssLink runat="server" Version="15">-->
            <!--ME:</SharePoint:CssLink>-->
            <!--MS:<SharePoint:CacheManifestLink runat="server">-->
            <!--ME:</SharePoint:CacheManifestLink>-->
            <!--MS:<SharePoint:PageRenderMode runat="server" RenderModeType="Standard">-->
            <!--ME:</SharePoint:PageRenderMode>-->
            <!--MS:<SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server" Localizable="false">-->
            <!--ME:</SharePoint:ScriptLink>-->
            <!--MS:<SharePoint:ScriptLink language="javascript" name="menu.js" OnDemand="true" runat="server" Localizable="false">-->
            <!--ME:</SharePoint:ScriptLink>-->
            <!--MS:<SharePoint:ScriptLink language="javascript" name="callout.js" OnDemand="true" runat="server" Localizable="false">-->
            <!--ME:</SharePoint:ScriptLink>-->
            <!--MS:<SharePoint:ScriptLink language="javascript" name="sharing.js" OnDemand="true" runat="server" Localizable="false">-->
            <!--ME:</SharePoint:ScriptLink>-->
            <!--MS:<SharePoint:ScriptLink language="javascript" name="suitelinks.js" OnDemand="true" runat="server" Localizable="false">-->
            <!--ME:</SharePoint:ScriptLink>-->
            <!--MS:<SharePoint:CustomJSUrl runat="server">-->
            <!--ME:</SharePoint:CustomJSUrl>-->
            <!--MS:<SharePoint:SoapDiscoveryLink runat="server">-->
            <!--ME:</SharePoint:SoapDiscoveryLink>-->
            <!--MS:<SharePoint:AjaxDelta id="DeltaPlaceHolderAdditionalPageHead" Container="false" runat="server">-->
                <!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->
                <!--ME:</asp:ContentPlaceHolder>-->
                <!--MS:<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true">-->
                <!--ME:</SharePoint:DelegateControl>-->
                <!--MS:<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server">-->
                <!--ME:</asp:ContentPlaceHolder>-->
            <!--ME:</SharePoint:AjaxDelta>-->
            <!--MS:<SharePoint:CssRegistration Name="Themable/corev15.css" runat="server">-->
            <!--ME:</SharePoint:CssRegistration>-->
            <!--MS:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
                <!--MS:<WebPartPages:SPWebPartManager runat="server">-->
                <!--ME:</WebPartPages:SPWebPartManager>-->
            <!--ME:</SharePoint:AjaxDelta>-->
            <!--CE: End Page Head Contents Snippet-->
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <!--DC:Two Tomorrows-->
           <link href="style1.css" rel="stylesheet" type="text/css" />
            <link href="slider.css" rel="stylesheet" type="text/css" />
            <!-- JS -->
            <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">//<![CDATA[!-->
            <script type="text/javascript" src="https://purplechannelltd-public.sharepoint.com/_catalogs/masterpage/DNV/js/jquery-1.10.2.min.js">//<![CDATA[
            //]]>
            </script>
            <script type="text/javascript" src="js/custom.js">//<![CDATA[
            //]]>
            </script>
            <script type="text/javascript" src="js/bjqs-1.3.min.js">//<![CDATA[
            //]]>
            </script>
            <script type="text/javascript" src="/Documents/clients_hover.js">//<![CDATA[
            //]]>
            </script>
            <script type="text/javascript" src="/Documents/jquery.backgroundSize.js">//<![CDATA[
            //]]>
            </script>
            <script type="text/javascript" class="secret-source">//<![CDATA[
            jQuery(document).ready(function($) {
              $('#banner-fade').bjqs({
                width       : 1600,
                height       : 377,
                responsive  : true
            //]]>
            </script>
            <script type="text/javascript">//<![CDATA[
    $(document).ready(function () {
        if((window.location.href=="https://purplechannelltd-public.sharepoint.com/")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/default.aspx")||(window.location.href=="https://purplechannelltd-public.sharepoint.com/Pages/default.aspx")
          $("#banner-fade").removeAttr("style");
          $("#BannerLine").removeAttr("style");
          $("#trBreadCrumb").css("display","none");
          $("#trNewsAndTraningHome").removeAttr("style");
          $("#trNewsOnly").css("display","none");
        else
         $("#banner-fade").css("display","none");
         $("#BannerLine").css("display","none");
         $("#trBreadCrumb").removeAttr("style");
         $("#trNewsAndTraningHome").css("display","none");
         $("#trNewsOnly").removeAttr("style");
        if((window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Services.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Key-issues.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Industries.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Clients.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/About-us.aspx")
        ||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/walking-the-talk.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/what-is-sustainability.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/our-team.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/assurance-code-of-conduct.aspx")
        ||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Contact-us-EMEA.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Contact-us-asia-pacific.aspx")||(window.location.href=="http://purplechannelltd-public.sharepoint.com/Pages/Contact-us-Americas.aspx")){
          $("#banner-fade").css("display","none");
         $("#BannerLine").css("display","none");
          $("#trBreadCrumb").css("display","none");
          $("#trNewsAndTraningHome").removeAttr("style");
          $("#trNewsOnly").css("display","none");
        if (window.location.href.indexOf("dnv-gl-launches-new-global-brand") >= 0 ||window.location.href.indexOf("how-future-proof-your-business") >= 0||window.location.href.indexOf("human-rights-time-walk-talk") >= 0 )
         $("#trNewsOnly").css("display","none");
        if($("#trNewsOnly").html().indexOf("Web Part Error:")>0)
        $("#trNewsOnly").css("display","none");
        if($("#trBreadCrumb").html().indexOf("Web Part Error:")>0)
        $("#trBreadCrumb").css("display","none");
            //]]>
            </script>
            <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>
    <mso:ContentTypeId msdt:dt="string">0x0101000F1C8B9E0EB4BE489F09807B2C53288F0054AD6EF48B9F7B45A142F8173F171BD10003D357F861E29844953D5CAA1D4D8A3A</mso:ContentTypeId>
    <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
    <mso:HtmlDesignFromMaster msdt:dt="string"></mso:HtmlDesignFromMaster>
    <mso:HtmlDesignStatusAndPreview msdt:dt="string">https://purplechannelltd-public.sharepoint.com/_catalogs/masterpage/DNV/TT.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
    <mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
        </head>
        <body>
            <!--CS: Start Ribbon Snippet-->
            <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SPM:<%@Register Tagprefix="wssucw" TagName="Welcome" Src="~/_controltemplates/15/Welcome.ascx"%>-->
            <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" HideFromSearchCrawler="true" EmitDiv="true">-->
                <div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex" xmlns="">
                    <a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById('linkTurnOffAcc').focus();return false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnonaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
                <div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex" xmlns="">
                    <a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById('linkTurnOnAcc').focus();return false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnoffaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
            <!--ME:</SharePoint:SPSecurityTrimmedControl>-->
            <div id="ms-designer-ribbon" xmlns="">
                <!--SID:02 {Ribbon}-->
                <!--PS: Start of READ-ONLY PREVIEW (do not modify) --><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; overflow:hidden;">The SharePoint
    ribbon will be here when your file is either previewed on or applied to your site.</div><!--PE: End of READ-ONLY PREVIEW -->
            </div>
            <div id="s4-workspace" xmlns="">
                <div id="s4-bodyContainer">
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" xmlns="http://www.w3.org/1999/xhtml">
                        <tr>
                            <td align="left" valign="top" class="headerLeft">
                            </td>
                            <td width="886" align="left" valign="top">
                                <div class="header">
                                    <a href="https://purplechannelltd-public.sharepoint.com/">
                                        <img src="images/logo.gif" width="189" height="109" alt="Logo" />
                                    </a>
                                    <h1>Sustainability Advisory Services
                                    </h1>
                                    <ul id="topNav">
                                        <li>
                                            <a href="http://purplechannelltd-public.sharepoint.com/Pages/About-us.aspx">About us
                                            </a>
                                        </li>
                                        <li>
                                            <a href="https://purplechannelltd-public.sharepoint.com/Pages/News.aspx">News
                                            </a>
                                        </li>
                                        <li>
                                            <a href="http://purplechannelltd-public.sharepoint.com/Pages/Contact-us.aspx">Contact us
                                            </a>
                                        </li>
                                    </ul>
                                    <!-- top nav -->
                                    <div style="right: 0px; ; color: rgb(0, 51, 153); font-weight: bold; top: 25px;">
                                       BUSINESS ASSURANCE
                                                                    </div>
                                    <!-- twitter -->
                                    <div class="twitterSec">RT @damidefelice: @edgeoftheocean Anna Turrel shows how @TwoTomorrows assesses corporate human right
                                    </div>
                                    <!-- twitter -->
                                    <!-- search -->
                                    <!--<form action="" method="get" id="search">
                                        <input name="" type="text" class="searchText"/>
                                        <input name="" type="image" src="images/search-icon.gif"/>
                                    </form>!-->
                                    <!-- search -->
                                    <!--ADD!-->
                                    <div id="search">
                                        <div data-name="SearchBox">
                                            <!--CS: Start Search Box Snippet-->
                                            <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint,
    Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                                            <!--MS:<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox">-->
                                                <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div class="ms-webpart-chrome ms-webpart-chrome-fullWidth
    "><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPart" width="100%" class="ms-WPBody noindex " OnlyForMePart="true" allowDelete="false" style=""><div componentid="ctl00_SmallSearchInputBox_csr" id="ctl00_SmallSearchInputBox_csr"><div
    id="SearchBox" name="Control"><div class="ms-srch-sb ms-srch-sb-border" id="ctl00_SmallSearchInputBox_csr_sboxdiv"><input type="text" value="Search..." maxlength="2048" accessKey="S" title="Search..." id="ctl00_SmallSearchInputBox_csr_sbox" autocomplete="off"
    autocorrect="off" onkeypress="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {if (Srch.U.isEnterKey(String.fromCharCode(event.keyCode))) {$find('ctl00_SmallSearchInputBox_csr').search($get('ctl00_SmallSearchInputBox_csr_sbox').value);return
    Srch.U.cancelEvent(event);}})" onkeydown="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {var ctl = $find('ctl00_SmallSearchInputBox_csr');ctl.activateDefaultQuerySuggestionBehavior();})" onfocus="EnsureScriptFunc('Search.ClientControls.js',
    'Srch.U', function() {var ctl = $find('ctl00_SmallSearchInputBox_csr');ctl.hidePrompt();ctl.setBorder(true);})" onblur="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {var ctl = $find('ctl00_SmallSearchInputBox_csr'); if (ctl){ ctl.showPrompt();
    ctl.setBorder(false);}})" class="ms-textSmall ms-srch-sb-prompt ms-helperText" ><a title="Search" class="ms-srch-sb-searchLink" id="ctl00_SmallSearchInputBox_csr_SearchLink" onclick="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {$find('ctl00_SmallSearchInputBox_csr').search($get('ctl00_SmallSearchInputBox_csr_sbox').value);})"
    href="javascript: {}"><img src="https://purplechannelltd-public.sharepoint.com/_catalogs/theme/Themed/E97CFE0A/searchresultui-61174269.themedpng?ctag=7" class="ms-srch-sb-searchImg" id="searchImg" alt="Search" ></a></div></div></div><noscript><div
    id="ctl00_SmallSearchInputBox_noscript">It looks like your browser does not have JavaScript enabled. Please turn on JavaScript and try again.</div></noscript><div id="ctl00_SmallSearchInputBox"></div><div class="ms-clear"></div></div></div><!--PE:
    End of READ-ONLY PREVIEW-->
                                            <!--ME:</SharePoint:DelegateControl>-->
                                            <!--CE: End Search Box Snippet-->
                                        </div>
                                    </div>
                                    <!--ADDEND!-->
                                </div>
                            </td>

  • Trying to use super class's methods from an anonymous inner class

    Hi all,
    I have one class with some methods, and a second class which inherits from the first. The second class contains a method which starts up a thread, which is an anonymous inner class. Inside this inner class, I want to call a method from my first class. How can I do this?
    If I just call the method, it will use the second class's version of the method. However, if I use "super," it will try to find that method in the Thread class (it's own super class) and complain.
    Any suggestions?
    Code:
    public class TopClass
         public void doSomething(){
              // do something
    =============================
    public class LowerClass extends TopClass
         // overrides TopClass's doSomething.
         public void doSomething(){
              // do something
         public void testThread(){
              Thread t = new Thread(){
                   public void run(){
                        doSomething();               //fine
                        super.doSomething();          //WRONG: searches class Thread for doSomething...
              t.start();
    }

    Classes frequently call the un-overridden versions of methods from their superclasses. That's that the super keyword is for, if I'm not mistaken.You're not mistaken about the keyword, but you're not calling the superclass method from a subclass. Your anonymous inner class is not a subtype of TopLevel. It's a subtype of Thread.
    Here it is no different, except that I happen to be in a thread at the time.It's vastly different, since you're attempting to call the method from an unrelated class; i.e., Thread.
    I could also be in a button's action listener, for example. It seems natural to me that if I can do it in a method, I should be able to do it within an anonymous inner class which is inside a method.If you were in an button's action listener and needed to call a superclass' implementation of a method overridden in the button, I'd have the same questions about your design. It seems smelly to me.
    ~

  • Edit a class file in Eclipse

    I am new to Java and Eclipse and Weblogic.
    I was give a .war file and told to simply edit a parameter that they thought was in one of the .jsp pages in the war file.
    the only occurance of the parameter name "SearchProvider" is in the Search.class file located deep in folders under the WEB-INF folder.
    the only way i could even find the parameter "SearchProvider" was with the use of an Effective File Search trial software.
    I opened (barely) the Search.class file with windows notepad and its mostly jibberish but I can find the reference to "SearchProvider" in the class file.
    I need to change this parameter.
    When I import this into eclipse, I get the message there is no source file attached to the class file Search.class.
    I added the entire class folder into the library. I tried to change the class source but all I have are just the files in the .war package.
    I have tried changing the extension to .jar and this will let me add these files as a project, but I cannot edit this Search.class file no matter what I try.
    My basic question is, Am I missing files from the client? Do I need more than just a war file?

    Most likely you are searching the wrong place, on an web application the first place to start searching is the web.xml, it is the core configuration file it will tell everything about your application including which other tecnologies are being used, like struts, it is very likely that the answer to your question lies in the web.xml file.

  • Creating A Binary search algorithm !!!! URGENT HELP

    hi ..
    i;m currently tryin to create a binary search algorithm ..
    the user should be able to input the size of the array
    and also the key that he would like to find.
    it also has to have to ability to measure the run time of the algorithm.. it how long it too the algorithm to search through the array and find they key..
    i have created 3 classes
    the first class is the binary search class
    which is the mathamatical side of things
    the second class is the Array
    this creates an array selection a random first number
    and then incrementing from there, so that its a sorted array
    the third class is the binary search class
    which is my main class.
    this class should take the users input
    and pass it to the array
    and the binary seach accordingly
    it should also measure the running time, from when it passes the array
    to the binary search class
    i am having a really hard time creating this last class.
    i have created the other 2 successfully
    the codes for the binary search class is as follows
    public class BinarySearch
         static int binSearch(int[] array, int val)
             // setting the start and the end of the array
              int low = 0, high = array.length;
              //While loop
              while(low <= high) {
              // How to find the mid point      
                  int mid = (low + high)/2;
                   // if the mid point is the value return the value
                  if(array[mid] == val) {
                        return mid;
                   // if the value is smaller than the mid point
                   // go search the left half
                   } else if(array[mid] > val) {
                        high = mid - 1;
                   //if the value is greater then the mid point
                   // go search the right half
                   } else if(array[mid] < val) {
                        low = mid + 1;
              // if value is not found return nothing
              return -1;
    }and the code for the Array class is as follows
    import java.util.Random;
    public class RandomSortedArray
        public int[] createArray(int length)
            // construct array of given length
            int[] ary = new int[length];
            // create random number generator
            Random r = new Random();
            // current element of the array; used in the loop below.  Starts at
            // -1 so that the first element of the array CAN be a 0
            int val = -1;
           for( int i = 0; i < length; i++)
                val += 1 + r.nextInt(10);
                ary[i] = val;
            return ary;
    }can some pne please help me create my binarysearchTest class.
    as i mentioned before
    it has to take the users input for the array size
    and the users input for the value that they want to find
    also needs to measure the running time
    thanks for all ur help in advance

    import java.util.*;
    public class AlgorithmTest
         public static void main(String args[])
             long StartTime, EndTime, ElapsedTime;
             System.out.println ("Testing algorithm");
             // Save the time before the algorithm run
             StartTime = System.nanoTime();
             // Run the algorithm
             SelectionSortTest1();
             // Save the time after the run
             EndTime = System.nanoTime();
             // Calculate the difference
             ElapsedTime = EndTime- StartTime;
             // Print it out
             System.out.println("The algorithm took " + ElapsedTime + "nanoseconds to run.");
        }this is the code i managed to work up for measuring the time..
    how would i include it into the main BinarysearchTest Class

  • Tomcat can't locate my class files

    Tomcat can't locat my class file for my javabeans in a jsp page.
    (Tomcat 4.1.24/windows XP)
    I have created inside of webapps a directory thesis and also the WEB-INF\classes and WEB-INF\lib. I don't know what should I put in web.xml so it is basically almost empty.
    this is the error I get where Searcher is my javabean:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:89: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] Searcher seek = null;
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:91: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] seek = (Searcher) pageContext.getAttribute("seek", PageContext.PAGE_SCOPE);
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:94: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] seek = (Searcher) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Searcher");
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:111: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] out.print(JspRuntimeLibrary.toString((((Searcher)pageContext.findAttribute("seek")).getAnalyze())));
    [javac] ^
    [javac] 4 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)

    did you create the Searcher class? if so stick it in a package and put it under your web-inf directory. then use an <%@ page import="" %> statement to import the code.
    if you didn't create the class is it in some jar library you downloaded? if so stick the jar file in your web-inf/lib folder.
    -S-

  • Query with search field in CS5

    I have recently upgraded to CS5.  In CS3, I developed several pages where there was a form where the user entered on search parameter, executed the query using the form method get and the results were displayed on the same page in a recordset.
    In CS5, I have used the same concept to build a search page but for some reason, I cannot get the results to appear.  I have compared the CS5 to the CS3 code and cannot find any differences.  I have attached my php page.  If anyone has any ideas, I would appreciate it.  I suspect it is something simple but cannot determine what it is.
    Thanks.  George
    http://www.cfoclinic.org/admin/regusers.php 
    $colname_Record = "-1";
    if (isset($GET_['input_year'])) {
      $colname_Record = $GET_['input_year'];
    mysql_select_db($database_cfouser, $cfouser);
    $query_Record = sprintf("SELECT * FROM CFO_Registration WHERE YEAR = %s and active = 'Y' ORDER BY Reg_id", GetSQLValueString($colname_Record, "text"));
    $query_limit_Record = sprintf("%s LIMIT %d, %d", $query_Record, $startRow_Record, $maxRows_Record);
    $Record = mysql_query($query_limit_Record, $cfouser) or die(mysql_error());
    $row_Record = mysql_fetch_assoc($Record);
    if (isset($_GET['totalRows_Record'])) {
      $totalRows_Record = $_GET['totalRows_Record'];
    } else {
      $all_Record = mysql_query($query_Record);
      $totalRows_Record = mysql_num_rows($all_Record);
    $totalPages_Record = ceil($totalRows_Record/$maxRows_Record)-1;
    ?>
    --- note  code skips ahead to following
    <form action="" method="get" name="Search" class="black11b" id="Search">
      <p> </p>
      <table width="386" border="1" align="center" class="black14b" id="table1">
        <tr>
          <th width="162" height="39" scope="col"><p>
            <input type="submit" name="Search" id="Submit" value="Execute">
          </p>
            <p>
              <input type="reset" name="reset" id="reset" value="Reset">
            </p></th>
          <th width="208" scope="col"><input name="input_year" type="text" id="year" size="4" maxlength="4"> <label for="input_year">Clinic Year</label></th>
        </tr>
        </table>
      <br>
    </form>

    Gunter,
    Unfortunately, it did not work.  I am re-attaching my code.  In addition to your comment, I added the first line listed below.
    Do you have any other suggestions?
    Thanks.  George
    $editFormAction = $_SERVER['PHP_SELF'];
    $maxRows_Record = 10;
    $pageNum_Record = 0;
    if (isset($_GET['pageNum_Record'])) {
      $pageNum_Record = $_GET['pageNum_Record'];
    $startRow_Record = $pageNum_Record * $maxRows_Record;
    $colname_Record = "-1";
    if (isset($GET_['input_year'])) {
      $colname_Record = $GET_['input_year'];
    mysql_select_db($database_cfouser, $cfouser);
    $query_Record = sprintf("SELECT * FROM CFO_Registration WHERE YEAR = %s and active = 'Y' ORDER BY Reg_id", GetSQLValueString($colname_Record, "text"));
    $query_limit_Record = sprintf("%s LIMIT %d, %d", $query_Record, $startRow_Record, $maxRows_Record);
    $Record = mysql_query($query_limit_Record, $cfouser) or die(mysql_error());
    $row_Record = mysql_fetch_assoc($Record);
    if (isset($_GET['totalRows_Record'])) {
      $totalRows_Record = $_GET['totalRows_Record'];
    } else {
      $all_Record = mysql_query($query_Record);
      $totalRows_Record = mysql_num_rows($all_Record);
    $totalPages_Record = ceil($totalRows_Record/$maxRows_Record)-1;
    ?>
    <form action="<?php echo $editFormAction; ?> " method="get" name="Search" target="_self" class="black11b" id="Search">
      <p> </p>
      <table width="386" border="1" align="center" class="black14b" id="table1">
        <tr>
          <th width="162" height="39" scope="col"><p>
            <input type="submit" name="Search" id="Submit" value="Execute">
          </p>
            <p>
              <input type="reset" name="reset" id="reset" value="Reset">
            </p></th>
          <th width="208" scope="col"><input name="input_year" type="text" id="year" size="4" maxlength="4"> <label for="input_year">Clinic Year</label></th>
        </tr>
        </table>
      <br>
    </form>

  • PC UI Advanced Search - Enhancement by standard fields of transaction table

    Hello,
    we are using CRM 5.0 SP13.
    We are familiar to enhance PC UI applications (BP+transactions) by EEW customer fields and how to use/hide them in the search functionalities etc.
    But now we need to enhance the advanced search for leads by the POSTING_DATE date of table CRMD_ORDERADM_H. Unfortunytely in PC UI advanced search structure for leads CRMT_BSP_LEA_SEARCH_ME the POSTING_DATE is not included like it is in the opportunity advanced search structure CRMT_BSP_OPP_SEARCH, where we were able to enhance the search easily by CRMC_BLUEPRINT_C customizing.
    The idea is to solve the problem to create EEW fields POSTING_DATE_FROM and POSTING_DATE_TO like they are existing in CRMT_BSP_OPP_SEARCH and use them in advanced search. So far no problem in creating and displaying the EEW fileds by CRMC_BLUEPRINT_C.
    But the part we are missing is to link the new EEW fields to the standard database-field POSTING_DATE and implement the search functionality "Searching by select option POSTING_DATE_FROM and POSTING_DATE_TO".
    Anybody any experience to link EEW-fields to standard fields of database tables for advanced search functionality in PC UI.
    Thank you for your help in advance.
    Best regards
    Marco

    Hi Marco,
    The best option here is to create redefination of the query method of the leads search class. Here you can first ensure that the call to the query method of super class takes place and the next would be do mapping between custom fields to local structure and then call the relevant API's to fetch the data.
    Best Regards, Adil

  • Linking 2 classes together

    This is always what i find hardest to do in java for some reason. Basically i have some code which is part of the class database, and this class adds records to my database as seen below;
    class Database
         public Database(){
         int answer = JOptionPane.YES_OPTION;
         int count = 0;
         final int ARRAY_SIZE = 12;
         CD[] data = new CD[ARRAY_SIZE];
         while (answer == JOptionPane.YES_OPTION)
         String a;
         String c;
         int n;
         a = JOptionPane.showInputDialog("Please, enter artist name");
         c = JOptionPane.showInputDialog("Please, enter CD name");
         n = Integer.parseInt(JOptionPane.showInputDialog("Please enter total number of tracks"));
         data[count] = new CD(a, c, n);
         answer = JOptionPane.showConfirmDialog(null, "Enter another record?",
                         "???", JOptionPane.YES_NO_OPTION);
         count++;
         System.exit(0);
    }Next i have a new class called search which is supposed to search for a CD typed in by the user. This is the code i have;
    class Search
    int result;
    String searchKey = JOptionPane.showInputDialog("Give me the name of a CD");
    result = linearSearch(data, searchKey, ARRAY_SIZE);
         if(result== -1)
         JOptionPane.showMessageDialog(null,"KEY " + searchKey + " NOT FOUND");
         else
         JOptionPane.showMessageDialog(null,"KEY " + searchKey + " FOUND in position " + result);
         System.exit(0);
    public static int linearSearch(String[] data, String key, int sizeOfArray)
    for (int counter = 0; counter < sizeOfArray; counter++)
    if (data[counter].equalsIgnoreCase (key))
    return counter;
    return -1;
    }How do i get the information from the database into my search class, because at the moment my search class wont compile due to identifiers being expected, most problably for the variables data and ARRAY_SIZE. Also, i am not sure if this makes a difference but the information i need from the database class is only the CD name and not the whole array object. If i am unclear, just let me know.
    Cheers

    above these 2 classes, i have a constructor and method which states my array object;
    class CD
         String artistName, CDname;
         int noOfTracks;
         public String records;     
         public CD (String ar, String cd, int no){
         //data that is passed is stored in variables below
         artistName=ar;
         CDname= cd;
         noOfTracks=no;
         String printData(){
         //processed data stored in variable record      
         records =artistName  + "    "+ CDname + "     " + noOfTracks ;
         //value of record returned
         return records;
    }Can i use this constructor and class to create a new method which will search the array, or do i have to create constructors for my other classes, and if so is it the database class or the search class i need these methods and constructors?

Maybe you are looking for

  • Intermittent Bug - htmldb_Get clobbers DOM body element - Apex4

    Hello, We recently started the process of upgrading to Apex4 and have had an issue with a call to htmldb_Get clobbering the DOM such that the body tag is emptied and thus nothing is rendered in the browser. But before jumping in too deep let me say t

  • Vendor Returns in MM

    Hi,     Could any one clear my FI related MM doubt. I created P.O., Received Goods and MIRO also done. Now using M.type 122 I am returning material and got the MIGO doc. number.    Now in MIRO what is the doc. type i have to choose? either credit mem

  • Menus not shown correctly.

    Hi!!, I�m developing an application but I�m having troubles making swing menus to be appeared. I got a JFrame and inside of this I got a Virtual Universe filling all panel. A JFrame MenuBar is attached to the JFrame, and when click on it menus are sh

  • Adobe acrobat professional Features

    I am planning on buying Adobe professional but want to ensure there is a particular feature I need. My plan is to have a simple web site to control the distribution of printed material in pdf format.  What I want is to control the life span of the do

  • Xsan expansion...no way to backup.

    Hi all, I have an xsan 1.3 setup that free space is now below 25%. I have purchased a new xraid that I want to add. I don't have any way of backing up my 4TB of data. I'm trying to find out if I'm taking to big of a risk adding the space without a pr