Context query

Hi everyone
I have just entered the world of tomcat and I am having difficulty addressing context issues.
I was hoping to make my web application portable in the sense that another developer could deploy the application and call it say, abc instead of xyz or the root app.
However I seem to be having trouble with this approach - I have to rename all the urls from
/servlet/validateuser (if it was the root app) to /abc/servlet/validateuser
I can't help but think I am misunderstanding how to use context properly. For instance is there a method that I need to call to get the context path before writing the url in a form tag? Or should I be able to setup a context and expect all my relative links to css files etc to work?
I could create a properties file to get the application name but I feel I am reinventing the wheel..
Anyone able to give me an idea how to use the context element properly, explain how to enter to docbase? Is it possible to avoid renaming al my urls when the app name changes?
confused
Stuart

Basically, you have the following choices :
- 1) An absolute path <img src="http://host.com/ctxt/images/img.gif"> is bad because you're hard coding the host.
- 2) A document relative path <img src="images/img.gif"> . The prob is that if we move the jsp/html pages and leave the images dir where it is, then we have to go back and change all the links .
- 3) A web root relative path. <img src="/ctxt/images/img.gif">
You can move the jsp/html pages anywhere in the web app and all links will still function. The prob is that you're hard coding the context root. The solution would be :
<img src="<%= request.getContextPath() %>/images/img.gif">
and that's the price you'll pay for 'context independence'...
You could ease the pain by writing a custom tag (or using an already existing one ?) that appends the call to all links, and use that tag by passing it were you want t to link to.

Similar Messages

  • ORA-29902 Error when executing context query

    We sometimes get the following error when executing a search based on keywords entered by a user:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Error generating context stmt ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: interMedia Text error: DRG-50901: text query <HR></BLOCKQUOTE>
    A demonstration of the error can be seen by going to the main
    http://technet.oracle.com technet page and then performing a site search. Type in any of the following search phrases:
    Oracle and not Microsoft
    not Microsoft
    and database
    In my brief experimentation, the presence of any of
    not, and, or
    at the beginning of the keywords, or next to each other 'and not' within the keywords set causes the above oracle error.
    OK, I could train the users not to do this, but with the potential for every net user on the planet using my site, it might take me some time to speak to all of them.
    So how do I stop Intermedia from throwing up the error? I have written a quick parser to try to strip out offending entries, but that is not, imho, a good solution, as I do not know all the rules that will break it.
    tia

    You need to write a text query parser. Check the Query Translator code samples from http://technet.oracle.com/sample_code/products/text/content.html

  • CONTEXT  TOP 10 ISSUES

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-15
    CONTEXT TOP 10 ISSUES
    ========================
    Explanation
    1. 프로시져 컴파일시 PLS-00201 과 "PL/SQL:Statement ignored" 에러의 발생하는
    문제.
    Stored procedure 컴파일시 다음과 같은 메시지가 나올 경우
    PLS-00201 : identifiier 'CTXSYS.CTX_QUERY' must be declared
    PL/SQL : Statement ignored
    ctxsys 유저에서 해당 사용자에게 CTX_QUERY 에 대한 execute 권한을 준다.
    -> grant execute on ctx_query to <user>;
    2. UNIX에서 ps 명령으로 ctxsys 유저의 패스워드를 볼 수 있는 문제.
    Unix에서 ps 명령으로 보면 다음과 같이 ctxsys 유저의 패스워드를
    볼 수 있다.
    /oracle/ora805/ctxsrv -user ctxsys/ctxsys -personality ...
    이 경우 다음 password 파일을 사용하여 ctxsrv를 기동시키면 패스워드를
    보이지 않게 할 수 있다.
    passwordfile.txt 파일에 ctxsys/<ctxsys password> 형식으로 편집한 후
    ctxsrv -personality QDM < passwordfile.txt &
    3 Two Step Query 실행시 ORA-20000, DRG-10801, DRG10010 이 발생하는 문제.
         Two-Step ConText query를 실행하면 다음과 같이 error가 발생할 경우
         exec ctx_query.contains('PROJ_DESC_POLICY','customer','RESULT4');
         ERROR at line 1:
         ORA-20000: ConText error:
         DRG-10801: text query failed
         DRG-10010: REQUIRED COLUMN DOES NOT EXIST IN RESULT TABLE
         -> 이 error는 result table에 textkey2 column이 없기 때문에 나는 error
    이다.
         composite textkey에 적절한 textkeyN를 가진 result table을 생성한다.
         예) exec ctx_ddl.create_policy(policy_name=> 'Proj_desc_policy',
         colspec=>'tprojects.column',textkey=> 'proj,title');
         Composite index가 'proj' 와 'title'의 두 column을 참조한다.
         create table result4(textkey,textkey2,score,conid);
    4. 64k가 넘는 파일을 CTXLOAD로 올릴때 DRG-11514, DRG-11508, DRG-11505가
    발생하는 문제.
    64k가 넘는 파일을 ctxload로 올릴때 DRG-11514, DRG-11508, DRG-11505가
    발생할 경우 ctxload command 에서 -longsize를 반드시 지정해 주어야 한다.
    예) ctxload -user scott/tiger -table htmltable -load loadhtm2
    -separate -longsize 100
    5. Context Linguistics 서버 기동시 DRG-00100 및 "Server shutting down"
    에러가 발생하는 문제.
    설치할 때 context의 linguistic 설정이 완결되지 않아 발생한 문제로 다음
    과같이 해결할 수 있다.
    cd $ORACLE_HOME/ctx/admin
    imp ctxsys/ctxsys file=ctxset.dmp full=y ignore=y
    6. 다른 사용자가 생성한 테이블에 대해 select priviledge를 부여 받고도, 그
    테이블에 대해 만든 policy로 structured query를 실행 할 경우 DRG-100[50801] 및
    ORA-1031가 발생하는 문제.
    select priviledge 이외에 grant option을 받아야 한다.
    grant select on <tablename> to <사용자명> with grant option;
    7. 다른 사용자가 생성한 테이블에 만든 policy로 질의 실행시 ORA-20000,
    DRG-10801, DRG10502, ORA-06512 가 발생하는 문제.
    ERROR at line 1:
    ORA_20000: Context error:
    DRG-10801: text query failed
    DRG-10502: policy 'policy name' does not exist
    ORA-06512: at "CTXSYS.DRUE", line 180
    ORA-06512: at "CTXSYS.CTX_QUERY", line 1417
    ORA-06512: at line 1
    이와 같은 에러 메시지가 뜰 경우 policy 및 index가 정상적으로 생성이
    되었는지, 그리고 대상 table에 대한 select 권한을 부여 받았는지 확인해 본
    다.
    8. Policy 생성시 ORA-200000 과 DRG-10503 이 발생하는 문제.
    exec ctx_ddl.create_policy('POLICY_NAME', 'table.tablecolumn');
    ORA-20000
    DRG-10503 suitable textkey not found
    이와 같은 에러가 발생할 경우 해당 테이블에 primary key를 지정해 주어야
    한다.
    alter table <table_name> add constraint primary key (column_name);
    9. Context 사용자를 cascade 옵션을 사용해서 drop 한 후 context server를
    기동시킬 때 DRG-50301,ORA-20000, DRG-11000, ORA-02292 가 발생하면서 기동이 되지 않는 문제.
    Context server 기동시 다음과 같은 에러메시지가 나오는 것은 사용자를
    cascade option으로 drop 시켰기 때문이다.
    DRG-50301 Server error reading request queue
    ORA-20000 Context error
    DRG-11000 failed to perform recovery for a server or client
    ORA-02292 integrity constraint (%s.%s) violated -child record found
    이것은 drop 된 context 사용자의 index, policy, preference가 계속 존재 하기 때문이다.
    해결책은 drop된 사용자와 동일한 이름으로 user를 만들고, 기존에 부여된
    role (ctxsys, ctxapp, ctxuser) 를 부여해 준 후, index, policy,
    reference를 순서대로 삭제해 주면 된다.
    10. Policy 생성시 DRG-10537, ORA-06512 발생하는 문제.
    exec ctx_ddl.create_policy('POLICY_NAME', 'tablename.colname');
    DRG-10537 textkey <col_name> length of 80 exceeds limit
    ORA-6512 at ctxsys.drue, line 110
    ORA-6512 at ctxsys.drue, line 833
    이 문제는 textkey가 시스템상에서 한계치인 64k를 넘어 설 경우 발생한다.
    exec ctx_ddl.create_policy(policy_name => 'POLICYNAME',
    colspec => 'tablename.colname', textkey => 'tablename.keycolname')
    과 같이 명시적으로 primary key 컬럼을 지정해 주어 unique constraint를
    가진 모든컬럼이 textkey에 포함되지 않도록 해 본다.
    Reference Ducumment
    ---------------------

    There is nothing like Top issues with it!!!!
    If you need to use DBlinks then you ought to use it, thats simple.
    The only thing is that you need to be aware of some facts:
    1) You should get access to the remote database for creating the DB links. Sometimes remote databases are goverened by different SLAs and hence its diffucult to get access to userid/password.
    2) Evaluate carefully before creating public database links, that might expose your remote database to all the local database accounts without your knowledge.
    3) With DB links comes into picture districuted transactions and hence expect execution plans etc behaving different in comparison to sqls accessing the same DB.
    4) Also be ready to view more DBA_2pc_pending and DBA_2pc_neighbors DD views, since due to any instablity in network between local and remote DB there might be in-doubt transactions.
    5) when clonding the PROD DB to test database, make sure to wipe out the dblinks so that nothing from test points to prod environment.

  • Context search on content + other field(s)

    I'm using oracle.ifs.search.* classes to do a context search on the content but at the same time I want to do a context search on the DOCUMENT.DESCRIPTION field.
    (A bit like what you can do when searching in this Forum)
    The ContextSearchSpecification only seems to allow 1 classname for the context Query.
    I could use a FreeFormQualification instead, I guess, but then I'm not only loosing late binding, but I cannot get to the score results and nor can I sort on the scores.
    Are there ways to overcome this ?
    Are there any examples on how to use a FreeFormQualification exactly ?
    null

    Another method that puzzles me a lot :
    oracle.ifs.search.ContextSearchSpecification.setMedia(oracle.ifs.beans.Media [] media)
    It is supposed to explicitly set the Media to search over. Can I use it to do a context search on multiple media ? It looks that way.
    oracle.ifs.beans.Media is not documented.
    Any examples of the use of setMedia ?

  • Context search if char [ or ( is typed by mistake - error DRG-50901

    If the search string has [ or (, why doesn't context treat it as
    a part of the string? Do I have to do anything special to avoid
    the run time error -
    ORA-20000: interMedia Text error: DRG-50901: text query parser
    syntax error on line 1, column 13
    Thanks in advance
    Vidhya

    I found this
    http://technet.oracle.com/products/text/x/Tech_Overviews/imt_817.
    html
    But it does not work as I expect
    The CTXCAT Query Language
    Once the ctxcat index is created, you query using the operator
    catsearch
    instead of contains:
    select item_desc from auction
    where catsearch(item_desc, 'oracle', null)>0;
    This finds all rows in auction which have "oracle" in the
    item_desc text.
    Like contains, the first argument is the text column, and the
    second is the
    query string. The third argument we'll talk about below -- just
    ignore it
    for now. There is no score label argument, because catsearch
    does not
    provide scoring -- it is a simple boolean search.
    The catsearch operator uses a much simpler query language than
    contains,
    with the intent that web-style queries can be passed through to
    catsearch
    without extra parsing. The query language rules are:
    * Multiple words are treated as an AND.
    * Vertical bar is used for OR.
    * A leading plus sign on words is ignored and discarded
    * A leading minus sign excludes words (must have included
    words)
    * Double quotes delimit phrases.
    * Parentheses group operations.
    Or, in comparison:
    catearch Query Equivalent contains query
    A B A & B
    A | B A | B
    +A -B           A ~ B
    "A B" A B
    "A B" C (A B) & C
    (A B) | C (A & B) | C
    AND, OR, AND-NOT, and PHRASE are the only functions currently
    available in the
    catsearch query language. catsearch does not support any of the
    other
    features found in the context query language such as accum,
    within, fuzzy,
    stem, wildcard, thesaurus, near, etc.

  • VPD context_sentisitive policy does not works as expected

    Hi,
    I'm trying to implement CONTEXT_SENSITIVE RLS policies:
    http://docs.oracle.com/database/121/ARPLS/d_rls.htm#ARPLS67721
    Server re-evaluates the policy function at statement execution time if it detects context changes since the last use of the cursor. For session pooling where multiple clients share a database session, the middle tier must reset context during client switches. Note that the server does not cache the value returned by the function for this policy type; it always executes the policy function on statement parsing. Applies to only one object.
    What I have discovered so far:
    1. policy function executed each time when query executed from SQL*Plus. Independently of context changes.
    2. policy function executed only once when query executed from PL/SQL.
    3.  When we have a PL/SQL procedure like this:
    begin
    <query>
    <change context>
    <query>
    end;
    Additionally, query (cursor) is not present in PL/SQL cursor cache, then
    policy functions executed only once when first query executed.
    So wrong results are possible when application context changed in a way that policy function returned predicate also changed.
    4. JDBC: policy function executed each time when query is executed. Policy function executed only once when I enabled statement caching:
    OracleDataSource ods =  new OracleDataSource();
    // skip
    ods.setConnectionCachingEnabled( true );
    ods.setImplicitCachingEnabled( true );
    Properties cacheProps = new Properties();
    cacheProps.put( "InitialLimit", "1" );
    cacheProps.put( "MinLimit", "1" );
    cacheProps.put( "MaxLimit", "5" );
    cacheProps.put( "MaxStatementsLimit", "50" );
    ods.setConnectionCacheProperties( cacheProps );
    5. Queries with RLS policies are not cached in the session cursor cache. For example, if we executed same query multiple times in SQL*Plus - then this query will be not cached.
    2 and 3 (PLSQL) relates to PL/SQL cursor cache.
    As a result, when we disable PL/SQL cursor cache (setting session_cached_cursors=0), then policy function executed each time in PL/SQL.
    What I have observed, it is not agreed with documentation on context_sensitive policies (I provided a link above):
    Server re-evaluates the policy function at statement execution time if it detects context changes since the last use of the cursor.
    Signature of DBMS_RLS.ADD_POLICY procedure was changed in 12c with additional arguments: NAMESPACE, ATTRIBUTE.
    I tried to use them with no luck, results are the same.
    In my opinion statements below are contradict to each other:
    1. Server re-evaluates the policy function at statement execution time if it detects context changes since the last use of the cursor.
    2. it always executes the policy function on statement parsing.
    First, documentation says that the policy function evaluates at statement execution time.
    Second, documentation says that the policy function executes on statement parsing.
    I have used Oracle Database 12.1.0.2 for testing.
    I provided a script that I have used in my tests:
    rls_policy.txt - creates test schema and policy
    rls_sqlplus.txt - runs simple select against query with RLS policy
    rls_plsql.txt - more complex example, runs some anonymous blocks with queries against table with RLS policy.
    In my opinion, context_sensitive policies does not works as described in the documentation.
    Is it a bug or I'm missing something?
    Please advice.
    Best regards,
    Mikhail.

    Thanks Scott. May i know why i should never use user policies for denying access?
    From my readings on some articles, there is no way to deny users permission in sharepoint after granting domain users with read access other than the web application user policy in our case (with certain reason, we need this group to be granted with
    read access but we would like to restrict small amount of users from seeing the page)

  • Where statement with a select statement

    Hi everybody
    Is possible to create a sql statement in query generator like:
    SELECT T0.[Name] FROM [dbo].[@FAMILIA_ARTIGOS_SUB]  T0 WHERE T0.[U_Familia] =SELECT $[OITM.U_Familia]
    Regards
    Vasco

    Hi!
    You are trying to create a form-context query that will be used in Items card, so it's enough to use
    SELECT T0.[Name] FROM [dbo].[@FAMILIA_ARTIGOS_SUB] T0 WHERE T0.[U_Familia] = $[OITM.U_Familia]
    No SELECT is needed in the end.
    If the problem is deeper, please define more exactly what is the aim of the task.
    hth,
    Alexey

  • Tasks

    hi
    i need to list the human tasks and i use the follow but i get the error:
    String realm = "jazn.com";
    String nullParam = null;
    String keyword = null;
    IWorkflowServiceClient wf = WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.JAVA_CLIENT);
    ITaskQueryService query = wf.getTaskQueryService();
    IWorkflowContext context = query.authenticate("oc4jadmin","welcome1", realm, null);
    //IWorkflowContext context = query.getWorkflowContext(contextId);
    Predicate.enableXMLSerialization(true);
    Predicate statePredicate = new Predicate(TableConstants.WFTASK_STATE_COLUMN,
    Predicate.OP_NEQ,
    IWorkflowConstants.TASK_STATE_ASSIGNED);
    statePredicate.addClause(Predicate.AND,
    TableConstants.WFTASK_NUMBERATTRIBUTE1_COLUMN,
    Predicate.OP_IS_NULL,
    nullParam);
    Predicate datePredicate = new Predicate(TableConstants.WFTASK_ENDDATE_COLUMN,
    Predicate.OP_ON,
    new Date());
    Predicate predicate = new Predicate(statePredicate, Predicate.AND, datePredicate);
    // Create the ordering
    Ordering ordering = new Ordering(TableConstants.WFTASK_TITLE_COLUMN, true, true);
    ordering.addClause(TableConstants.WFTASK_PRIORITY_COLUMN, true, true);
    List queryColumns = new ArrayList();
    queryColumns.add("TASKNUMBER");
    queryColumns.add("TITLE");
    queryColumns.add("PRIORITY");
    queryColumns.add("STATE");
    queryColumns.add("ENDDATE");
    queryColumns.add("NUMBERATTRIBUTE1");
    queryColumns.add("TEXTATTRIBUTE1");
    List optionalInfo = new ArrayList();
    optionalInfo.add(ITaskQueryService.OPTIONAL_INFO_ALL_ACTIONS);
    List tasksList = query.queryTasks(context,
    queryColumns,
    optionalInfo,
    ITaskQueryService.ASSIGNMENT_FILTER_MY_AND_GROUP,
    keyword,
    predicate,
    ordering,
    0,0);
    if (tasksList != null) { // There are tasks
    System.out.println("Total number of tasks: " + tasksList.size());
    System.out.println("Tasks List: ");
    Task task = null;
    for (int i = 0; i < tasksList.size(); i++) {
    task = (Task) tasksList.get(i);
    out.println("Task Number: " + task.getSystemAttributes().getTaskNumber());
    System.out.println("Task Id: " + task.getSystemAttributes().getTaskId());
    System.out.println("Title: " + task.getTitle());
    //// error////
    ORABPEL-30501
    Error in authenticating user.
    Error in authenticating and creating a workflow context for user jazn.com/oc4jadmin
    Check the underlying exception and correct the error. Contact oracle support if error is not fixable.
         at oracle.bpel.services.workflow.verification.impl.VerificationService.authenticateUser(VerificationService.java:345)
         at oracle.bpel.services.workflow.query.impl.TaskQueryService.authenticate(TaskQueryService.java:138)
         at lista.jspService(_lista.java:73)
         [lista.jsp]
         at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:595) .... and continue
    please help

    Hi,
    Could you try this:
    IWorkflowContext wfCtx = wfSvcClient.getTaskQueryService().authenticate(userId, password, oracle.tip.pc.services.identity.config.ISConfiguration.getDefaultRealmName(), null);Maybe the realm is different, the above getDefaultRealmName method gets the realm from you is_config.xml configuration. You could also try the bpeladmin user istead of oc4jadmin.
    Kind regards,
    Andre

  • CTXCAT index support MULTI_COLUMN_DATASTORE?

    I've been using a CONTEXT index in my app, however, having to re-synchronize the index is an issue with my high insert rate. So, I'm considering using a CTXCAT since all db updates are transactional.
    However, my CONTEXT query uses a MULTI_COLUMN_DATASTORE to query multiple columns via the concatenated column and it doesn't look like the CTXCAT index will support MULTI_COLUMN_DATASTORE? Does anyone know?
    If the MULTI_COLUMN_DATASTORE is not supported, is there an alternative query I could use whilst still being able to use CTXCAT index?
    Many thanks!

    Hi David,
    Until you get to 10g would a job that sync's frequently work? It sounds like the new sync on commit is what you need (provided it wouldn't cause performance problems for you), so would the job be an acceptable workaround until you upgrade?
    -Ron

  • Crawl Works Fine. All Sites Scope shows 0

    Hello,
      We have recently built a 2010 SharePoint server.  We have several sites containing shared documents.  A Search Service Application has been created and a Content Source of all sites on the Local SharePoint server is being used.  When
    a Full Crawl is performed, it is successful and the URL log shows all of the shared documents.  When I try to use the search.asmx API by sending an SQL style select to it, I either just get the Person entries or nothing if I specify the 'All Sites' scope.
     After reading other posts, I have checked for errors in my logs, and ensured proper user permissions.  Any ideas?
    Thanks,
    Warren

    Hi,
    According to your post, my understanding is that you could not get the result using search.asmx web service.
    What SQL syntax were you use? For example, we can get the doc file in the
    Lib1 libray as below.
    <QueryText language="en-US" type="STRING">site:”http://sps/Lib1 doc”</QueryText>
    I did a simple code demo using Windows Form Application follow
    the MSDN article, it works like a charm, you can have a look at it.
    private void queryButton_Click(object sender, EventArgs e)
    try
    // Instantiate the Web service.
    QueryWebServiceProxy.QueryService queryService = new QueryWebServiceProxy.QueryService();
    // Use the credentials of the user running the client application.
    queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    //Execute the QueryEx method, returning the results to a DataSet
    System.Data.DataSet queryResults = queryService.QueryEx(GetXMLString());
    // Set the DataGridView data source to the first table in the DataSet oject, which contains the relevant results.
    resultsGrid.DataSource = queryResults.Tables[0];
    catch (Exception ex)
    resultsLabel.Text = ex.ToString();
    private string GetXMLString()
    The proceeding six lines of code is actually one line of code.
    It is separated into four lines here for readability.
    You will need to remove the line breaks when you copy the code to your project.
    StringBuilder xmlString = new StringBuilder(@"<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>
    <Query domain='QDomain'>
    <SupportedFormats>
    <Format>urn:Microsoft.Search.Response.Document.Document</Format>
    </SupportedFormats>
    <Context>
    <QueryText language='en-US' type='STRING'>");
    xmlString.Append(queryTextBox.Text);
    xmlString.Append("</QueryText></Context></Query></QueryPacket>");
    return xmlString.ToString();
    More reference:
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/07/17/how-to-query-search-using-the-web-service.aspx
    http://sharepoint.stackexchange.com/questions/32709/how-to-use-the-search-asmx-service-to-search-a-particular-library
    Thanks,
    Jason
    Forum 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].
    Jason Guo
    TechNet Community Support

  • How to use oracle.ifs.search.ContextSearchSpecification.setMedia()

    The javadoc states that "The user can also specify the Media on which the Text Queries are to be performed".
    How ?
    The Media[] argument of this method is not documented and there seems to be no constructor for the class either.
    I want to make a context query on content in one class + on description (or also content if that were impossible) in another class.

    Tom
    This allows a content search on description.
    It uses the FreeForm SQL ability. It gets the score for the search of the related Content. I'm not sure if I can get the score for the description search.
    // $Header$
    // Copyright (c) 2000 Oracle Corporation
    package ifs.pm.examples.search;
    import ifs.pm.common.application.*;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.ContentObject;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.beans.Search;
    import oracle.ifs.beans.SearchResultObject;
    import java.io.BufferedReader;
    import java.io.IOException;
    import oracle.ifs.search.*;
    * A Class class.
    * <P>
    * @author Mark D. Drake
    * Please complete these missing tags
    * @rref
    * @copyright
    * @concurrency
    * @see
    public class ExtendedContentSearch extends BaseTestHarness
    * Constructor
    * Please complete the missing tags for ContentSearch
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public ExtendedContentSearch()
    * Please complete the missing tags for doSomething
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public void doSomething( LibrarySession ifs )
    throws IfsException
    ifs.setAdministrationMode(true);
    SearchSpecification searchSpecification = buildSearch( Document.CLASS_NAME, "doc", "zydeco" );
    Search search = new Search( ifs, searchSpecification );
    search.open();
    SearchResultObject [] results = search.getItems();
    search.close();
    if( results != null )
    System.out.println("The number of object found is " + results.length);
    for( int i = 0; i < results.length; i++ )
    SearchResultObject sro = results [ i ];
    Document doc = ( Document ) sro.getLibraryObject( Document.CLASS_NAME );
    System.out.println( "Document : " + doc.getName() + " Score (query1) = " + sro.getScore("query1"));
    doc.filterContent( false );
    BufferedReader reader = new BufferedReader( doc.getFilteredContent() );
    try
    for( String nextLine = reader.readLine();
    nextLine != null;
    nextLine = reader.readLine() )
    System.out.println( nextLine );
    catch( IOException ioe )
    throw new IfsException( 9999, ioe );
    else
    System.out.println("No Results Found");
    * Please complete the missing tags for buildSearch
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public SearchSpecification buildSearch( String className, String fileExtension, String phrase )
    throws IfsException
    // Document.DescriptionAttribute contains 'phrase';
    AttributeQualification aq1 = new AttributeQualification();
    aq1.setAttribute( Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE );
    aq1.setOperatorType( AttributeQualification.LIKE );
    aq1.setCaseIgnored( true );
    aq1.setValue( "%doc" );
    // Document.ContentObject = ContentObject.ID
    JoinQualification jq1 = new JoinQualification();
    jq1.setLeftAttribute( className, Document.CONTENTOBJECT_ATTRIBUTE );
    jq1.setRightAttribute( ContentObject.CLASS_NAME, null );
    // Combine the Attribute and Join Qualifications
    SearchClause searchClause = new SearchClause( aq1, jq1, SearchClause.AND );
    // Create the Content Query 'Document Body contains phrase...' and add it in.
    String queryName = "query1";
    ContextQualification contentClause = new ContextQualification();
    contentClause.setQuery( phrase );
    contentClause.setName( queryName );
    searchClause = new SearchClause( searchClause, contentClause, SearchClause.AND );
    // Add in the FreeForm Search....
    FreeFormQualification fq1 = new FreeFormQualification();
    fq1.setSqlExpression("contains(description,'Temporary',2) > 0");
    searchClause = new SearchClause( searchClause, fq1, SearchClause.AND);
    // Set up the Search Class Spec.
    SearchClassSpecification scs = new SearchClassSpecification();
    // Add in the Class for the Where Clause
    String [] searchClasses = new String []
    className,
    ContentObject.CLASS_NAME
    scs.addSearchClasses( searchClasses );
    // Add in the Class for the Select Clause
    scs.addResultClass( className );
    // Define the Order by Clause
    // The List of Classes for the Order Clause
    String [] classNames = new String []
    ContentObject.CLASS_NAME
    // The List of Attibutes for the Order Clause.
    String [] attributes = new String []
    ContextQualification.ORDER_PREFIX + "." + queryName
    // The Ordering for the Attributes in the Order Clause
    boolean [] sortOrder = new boolean []
    false
    SearchSortSpecification sss = new SearchSortSpecification( classNames, attributes, sortOrder );
    // AttributeSearchSpecification searchSpec = new AttributeSearchSpecification();
    ContextSearchSpecification searchSpec = new ContextSearchSpecification();
    searchSpec.setContextClassname( ContentObject.CLASS_NAME );
    // Set the SELECT statement and FROM statement of the search
    searchSpec.setSearchClassSpecification( scs );
    // Set the WHERE clause of the Search
    searchSpec.setSearchQualification( searchClause );
    // Set the ORDER by clause of the search
    searchSpec.setSearchSortSpecification( sss );
    return searchSpec;
    * main
    * @param args
    * Please complete the missing tags for main
    * @return
    * @throws
    * @pre
    * @post
    public static void main( String [] args )
    ExtendedContentSearch contentSearch = new ExtendedContentSearch();
    contentSearch.run();
    null

  • Query about XAResource.end() API in JMS context

    Hi All,
    I have a small query regarding the behavior of an XAResource supplied by a JMS server.
    Suppose I start a transaction using XaResource.start() method and I create a publisher and registered durable subscriber on the XASession that supplied the above mentioned XAResource. After that I send some messages and receive some messages from a Topic that already had some messages for the concerned Subscriber.
    Now I end this transaction by calling XaResource.end() with the flag TMSUSPEND.
    My question is that can the Publisher and Subscriber objects created between the start() and end() methods of the XAResource object be used now after the transaction has been suspended.
    Also now if I resume this transaction can I use these publisher and subscriber objects again without re-creating them.
    It would be great if some of the bright people on this forum can share some info on this.
    cheers
    Adolf

    Now I end this transaction by calling XaResource.end()
    with the flag TMSUSPEND.
    My question is that can the Publisher and Subscriber
    objects created between the start() and end() methods
    of the XAResource object be used now after the
    transaction has been suspended.This is dependend on the JMS implementation. If it falls back into a local transaction context after suspending the current XA tx, then yes, otherwise no.
    Also now if I resume this transaction can I use these
    publisher and subscriber objects again without
    re-creating them.IMO, yes.
    However, chapter 8 of the JMS spec (XA/ASF) is intended to use within a J2EE environment. Thus, most of the behavior of JMS XA/ASF is specified in the EJB spec, not in the JMS spec. If you consult both, you'll get the whole picture. Whether JMS XA/ASF works with a specific app server is dependent on the app server's implementation of this part. For example, some use ASF (connection consumers) with callbacks for message/tx association (like the J2EE ref impl), some use ASF without callbacks (like JBoss, WebSphere) so there has to be an automatic association with XAResource.start. Some don't use ASF at all but a message consumer (like WLS). And so on. JCA 1.5 with JMS pluggability uses callbacks.
    It's very tricky and time consuming to integrate a JMS server XA/ASF wise into an app server. Every app server is different. Sometimes you'll have to implement proprietary interfaces to plug into it.
    We have done that. How it works is here:
    http://www.swiftmq.net/products/kernel/jmsxaasf/index.html

  • Report Export - No data when query based on Application Context

    I updated my Query Region source to use a Global Application Context and now the Report Export (to .csv) download has no data. This appears to run the query again in under a different session_id perhaps(?)
    In a before header process I set the session_id to access a couple of date values set by the user via LOVs - the 'Search' button and an After Submit Process sets the context values which are accessed in the where clause, i.e
    where date_attribute between to_date( SYS_CONTEXT('MY_CTX', 'START_DATE'), 'dd-Mon-yyyy')
    and to_date( SYS_CONTEXT('MY_CTX', 'END_DATE'), 'dd-Mon-yyyy')
    If you know any solution or alternative approach I'd be very grateful for your tips. I like Apex because you can leverage core Oracle database technology but then in some case you do hit these little troubles!
    Thanks
    Craig

    Thanks for the link to the posts.
    I considered the Security Attribute but thought that was somewhat inappropriate for just the one page I am setting the context; I understand the Security Attribute function would set 'My_Ctx' values on all page requests.

  • Ordering MDX query wih Named set gives error, "The CURRENT function cannot be invoked in this context ".

    Hi,
    I have following Query 
    WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
    [Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
    SELECT {[Measures].[Emp Count]} ON 0,  
    {ORDER({[Union].[Union City].[Union City]*[Union name set test]}, 
    [Union name set test].CURRENTMEMBER.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
    when i run this query from code as well as SSMS i get following error...
    The CURRENT function cannot be invoked in this context because the 'Union name set test' set is not in the scope.
    Please help me for this ....

    Hi Mihirhp,
    Base on my research, there are some similar issues and the resault turn out that the Tabular model engine can’t associate .currentmember with a set. The workaround  is to use .current in the MDX query. Please try the query below.
    WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
    [Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
    SELECT {[Measures].[Emp Count]} ON 0,
    {ORDER({[Union].[Union City].[Union City]*[Union name set test]},
    [Union name set test].CURRENT.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Choosing a Context when running a Query

    Hello,
    I have 4 Facts Tables my Universe A, B, C & D, thus have 4 context paths
    A, B, C and fact tables and share common dimensions within them.  D is a view which I created which takes the value from the A & B Fact tables .
    I ran a query which takes all values from D and it works fine, however when I run a query taking all values from either A or B, it asks me to choose the context.  The best part is that the context which query is based out of is not selected. 
    Question) How do I ensure that I do not get this message every time, as the intent is that all the data for all the filters will be dumped into Excel via QAAWS for the Xcelsius dashboard.
    Please advice.

    I have a star schema, ie 5 FACT tables and 7 dimension tables, All fact tables share the same dimension tables, some FACT tables share 3 dimesnsions, while other share 5 dimensions.  
    I did adopt the best practices, and as recommended in the book, I tried to resolve them using Context, as it is the recommended option to Alias in a star schema setting.  The contexts are resolved, but I still have loops.  I also cleared the Multiple SQL Statement for each context option, but no luck.  I need to get this resoved ASAP,
    I checked all the context and they look fine, however when I again go to detect context it asks me to add the context which is already present.  It give me an option to overwrite?  Besides, I also get some Alias options.  However I was told and it was mentioned in the book that Alias is not a good option to resolve loops but context is when you have a STAR SCHEMA.
    Please suggest idea.
    AP

Maybe you are looking for

  • Error in searching a community site in SP 2013 in Community portal template based site

    hi, I have created a community site collection and created few subsites with community site template. after this, i have created a community portal template such that i can search for the popular communities in this template. [ using content search w

  • Calling custom pl/sql package on termination of Employee

    Hi, I want to call a custom pl/sql package that will create an element entry for employees, with their outstanding holiday entitlement upon termination. One way I have tried to do this is by personalizing the end employment form, but I get this error

  • Installing a Torrent Download of Mac OS X 10.4 - does it work? Is it safe?

    Does anyone know about Torrent Downloads? The service is not free, so I want to be sure it's alright before signing up. I want to upgrade my Panther OS to Tiger. I have a 30GB hard drive. I also have a DVD drive.

  • HorizontalScroll does not show all the time

    So I have a custom skin, which I have a scroller in to warp the content. Below is my content.  If "holderGroup" has the property width=100% then the horizontalScroll doesn't show when the browser window is sizedsmaller than the content.  But if I rem

  • Compressing video for web HTML5

    When I'd create a video intro for a website, I used to export to the FLV format, but since Apple's made it clear that Flash isn't going to be supported, what is the preferred way (compression format) to deliver video that will play universally on eve