Control the query of Content By Search web part or a Catalog-Item Reuse web part from JavaScript

Is it possible/supported to intercept and change the query before it gets issued by a Content By Search or Catalog-Item Reuse webpart?
I am writing a multilingual site utilizing cross-site publishing mechanism, and the out-of-box (OOB) web parts would perfectly work if not for the following requirement that I've got: I need to serve location-specific content to the end user. I have several
versions of each content page for each geographical location, and I have tagged the pages accordingly with managed metadata keywords. I also can deduce the user's location from her browser's IP address and store it in a JavaScript variable. It is here
where I am getting stuck: I am trying to change on the fly the queries the web parts issue in order to attach the information about the user's geographical location, unsuccessfully so far.
I cannot rely on server-side code unless it is a cloud-hosted app code. I am about to give up and consider a custom solution alternative instead, which would be relying on Search REST API and custom client-side scripted widgets in place
of the OOB search web parts. This seems like an expensive alternative as the entire site could have been built using the OOB web parts, if not for the location requirement.
I would appreciate any suggestions.
Thanks in advance,
Ivan.

hi
I would check several directions:
- in query transformation you may add keyword filter "Value of a field on the page". Documentation doesn't clearly says what "field" means here: is it only for site columns, or also may work for UI controls on the page. In second case it would solve your
problem (it would be possible to add hidden field on the page and set value via javascript). But chances that it works like this are not high;
- in the query settings of the Content by search web part there is setting "Loading behavior": Choose whether this query is issued on the server while the page is loading, which is better for your main content, or from the browser after the page appears.
I.e. if you will choose 2nd option there will be a chance to intercept the query on the client side in theory. All of this requires experimenting of course;
- by default Content by search web part sends query to /_vti_bin/client.svc/ProcessQuery with http post from client side (you may check it in fiddler). You may try to find the exact javascript function which performs the call and override it by adding additional
conditions to the query (fortunately it is not complicated in javascript).
Blog - http://sadomovalex.blogspot.com
Dynamic CAML queries via C# - http://camlex.codeplex.com

Similar Messages

  • Content Query Web Part - in 2010 but Catalog-Item Reuse in 2013

    In SharePoint 2010 I exported this SharePoint Links List to be a WebPart that I can put for things.  It's our company's "Popular Links."  "WE" decide what is "Popular."  We have a few that I am sharing here. 
    In 2010 I got this to be a web part that I can pop onto multiple sites on our site collection.  Now in 2013, I'd like to use Search if possible to get this to work.  I tried and it didn't come out right.
    SharePoint 2013 Enterprise Edition RTM dec 2013 CU
    I tried the Items Matching a Tag and I set a tag to be "Popular Links" and set the tag on the items below in this graphic.  I then set it to look only at these.
    This is on the same page on the "home" page, publishing turned on.  I don't have the "feel" of the first "list" that I did on the graphic above.  It's not CSS as it is on the same page using the same master page. 
    Also when I click on the link it takes me to the displayform.aspx?id=1 page and I want to have the user just click the hyperlink.
    Could I / should I use the Catalog-Item Reuse feature with publishing and get a new site collection setup with this?  I am frustrated as I'd like to "share" information in another site, just as this "perfect" example (for me) to
    show this information multiple times.
    Thank you!

    CQWB is supported for Publishing Sites or site having publishing feature turned on, on other it will not work as expected.
    You can add it on the page from ribbon insert web part> from categories select Content Rollup > next pane slect Content Query.
    http://info.axceler.com/Blog/bid/116286/Content-Query-Web-Part-vs-Content-Search-Web-Part
    http://www.cwheeler76.com/Lists/Posts/Post.aspx?List=9a19060b-0efe-4368-8360-b07d23dc5c7b&ID=6&Web=916c3f13-7f62-4b71-b302-6fd9106b4bb2
    here is MSDN to customize it:
    http://msdn.microsoft.com/en-us/library/ff650512.aspx 
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Af:query how to control the query combobox and change it's label text

    My colleague designed a well working af:query search page with several selectable predefined queries. Now it's up to me to control this combobox from outside the component with big colored buttons for user convenience. If the user clicks on one of the big buttons, the assigned item of the combobox is selected and then the query is submitted.
    I though about doing this with javascript, but the difficulty is, that I have no idea and didn't find a way to reference the id of the combobox? The combobox is a 'built in' component in he af:query component and there is no way to give it an id in the properties.
    The second problem is that I didn't find a way to change the label text of the combobox. It seems to be hard coded?
    Thanks in advance for your suggestion!

    Hi,
    the text should be coming from a message bundle and some other look and feel related elements should be settable through skinning in CSS
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/skin-selectors.html
    search for af|query
    Regarding the JavaScript access, use firebug JS debugger. The af query class is AdfRichQuery.js
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/multiproject/adf-richclient-api/js_docs_out/AdfRichQuery.html
    Note however that you should be able to do in Java what you are aimning for in JavaScript. However the usecase you want to implement is not fully clear to me - to be honest
    Frank

  • Problem in the The Query... to search a part of Record

    HI friends,
    I have to serach some records from the table. But the records in the table are like this
    Uname----------DocNo---------- DocDate
    ashish----------vsg-1000----------07-23-2007
    leena----------vsg-1001----------07-20-2005
    chinu----------vsg-1059----------12-12-2006
    Now user is giving a range say: startingDocNo: 1005 endDocNo: 1045
    Here the query should return all the records between
    vsg-1005 to vsg-1045.
    How can i search this. What is the procedure to do this. vsg- is always prefixed to the no.
    Please tell me about this. thanks for your answer in advance..

    You can use LTRIM function in the where clause to trim 'vsg-'.
    E.g:
    select uname,docno,docdate
    from table1
    where to_number(ltrim(docno,'vsg-')) between 1005 and 1045PS: To improve the performance, create a function based index on to_number(LTRIM(docno,'vsg-'))

  • Hi, I still use an iPhone 4, ever since my recent update of iOS I cannot purchase apps from the App Store, and a message keeps appearing saying that, 'this item cannot be purchased from the US store, and please switch to the Malaysia store''.

    I keep getting this message when I try to update my apps and when trying to purchase new apps from the App Store. I checked my iTunes ID and it turns out that the country shown there is the one that I am actually living in. And it is the same as my billing address, but when I tried to update my apps again, I keep getting this message, 'you are not eligible for purchase of this item from the US store, please switch to the Malaysia store'. How do I solve this issue.
    Besides ever since I updated my phone iOS it has started misbehaving, quite irritably at times. Dropped calls, slow typing, apps open very slowly, apps cannot be updated with prompts coming up like, this app cannot be updated now, please try again. I had to delete quite a few apps and reinstall them again. I had a trouble free experience with this phone till now, but is apple losing its magic. 

    Thanks too all the people who responded. . . . (noone)
    Got it sorted though. Seems that Apple has issues with multiple apple id's.
    Seems i had to somehow remember and use the original id i had when i first bought my 1st iPhone. . . .
    Even after that it was extremely hard to get my apps back on my PC.
    If anyone else has the same problem. . . .email Apple. Cya.

  • Error when excute the query in web

    Hi ,All ,
       I created the query in BI analyzer, when i excute the query in excel ,it run ok .but wehn i excute it by web ,it go to dump , the error message is as follow :
    program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION .
    system error in program :CL_RSR_RRKO_ATTR_C and form_CHECK_ALVL_01(see long text) .
    can anybody help me ,thanks very much .
    Jialiang.Qiu

    can u run other queries in web or not..
    what i intend tos ay is
    if u cannot run other queries thru web then there can be possibility that the Web server is not integrated correctly with the bi analyzer or so....
    or the integration of servers exists from query designer to Web portal but not between analyzer and web etc.
    try to contact basis and see if this is the issue or not
    try to run some other queries thru analyzer to web
    try to run queries thru query designer to web

  • How to find who has deleted the query in Production system

    I Experts,
    I have an issue. Someone has deleted one query in Production system.
    How can i find who has deleted the query??
    I searched the ans for the same i the below threads :-
    Query deleted in production
    How to find out who has deleted the production Query
    But it didn't help me as i couldn't understand how to use the transaction SLG1.. Can Someone please explain me how can i find out who has deleted the Query..
    Regards,
    Pavan Raj

    Hello,
    Please, remember the date on which date the query has seen last time  in the production server. You can use the last date in the From date and To date would be current  date and execute the SLG1 tcode. It would list you all the logs in the Object text you can search for BEX Query designer and sub object text column you can check for delete logs options.
    Double click on the object will list you the query and name. From the user column you can find who has deleted the query.
    Might be this can help you for analysis.
    Thanks
    Geeta Sharma

  • The Query output should bring 0 from 0 records

    Hi Guru's
         I have a critical requirment in my project, I have to build an query on BW statistics  Multi provider ( 0BWTC_C10 ).
           The Query should result an output with an exception when any data load brings 0 from 0 records to the info provider
    Please suggest me as what key figures  and the stucture i need to take in the query in order to get the desired output.
    Respond ASAP as the ticket should be closed today
    Thanks in advance

    Hi KR MR,
      Try with thses info objects
    0TCTREQSID                       Data Request (SID)
    0TCTIFCUBE                        InfoCube
    0TCTMNRECO                     Records (WHM Process)
    & use time characteristics..........
    if u want u can additional char like........source system for navigational purpouse.................
    Regards,
    Vijay.

  • How to modify the query to get max id record

    Hi All,
    How to modify below query to get proper result.The query is returning some records are duplicated.I need only one record to display from duplicate based on max assetid.
    Here is my query:
    SELECT *
    FROM (
    SELECT a.uppertitle, a.composer, a.esongid,
    MAX (asset_new.assetid) AS assetid,asset_new.ownerid
    FROM (SELECT DISTINCT NVL (esong.title, '~') AS uppertitle,
    INITCAP (NVL (esong.composer, '~')
    ) AS composer,
    esong.esongid
    FROM esong, esongcountry_us eus
    WHERE 1 = 1
    AND eus.esongid = esong.esongid
    AND eus.isocountrycode IN ('US')
    AND esong.title LIKE 'LIVE TO TELL%'
    AND ROWNUM < 390) a,
    songwebrecording,
    recordingasset_new,
    asset_new
    WHERE a.esongid = songwebrecording.esongid(+)
    AND songwebrecording.recordingid = recordingasset_new.recordingid(+)
    AND recordingasset_new.assetid = asset_new.assetid(+)
    GROUP BY a.uppertitle, a.composer, a.esongid,asset_new.ownerid)
    WHERE ROWNUM <= 390
    ORDER BY uppertitle
    result:
         upperlittle composer esongid assetid onwerid
    1.     LIVE TO TELL Gelb, Howe 480340000 null      null
    2. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 null null
    3. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3080366 null
    4. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3038107 null
    5. LIVE TO TELL THE TALE Holopainen 859841500 nulll nulll
    I need the result like this :
         upperlittle composer esongid assetid onwerid
    1.     LIVE TO TELL Gelb, Howe 480340000 null      null
    2. LIVE TO TELL FROM THE Madonna (Ca)/ Leonard 125559900 3080366 null
    3. LIVE TO TELL THE TALE Holopainen 859841500 nulll nulll
    Please help me on this regard. oracle version is 9i
    Regards,
    Rajasekhar

    can you please format your code with                                                                                                                                                                                                                        

  • Please optimize the query

    Hi,
    I have a query that will select the same tables and using Subquery. The query is taking too much time as the table has more records. Can anyone help to modify the query which can take minimum time. Thanks in Advance.
    Below is the query
    SELECT
    SIK_ROLLE_ID,SIK_OBJEKT_ID,SIK_AFTALE_ID,SIK_AFTALE_TP,ROLLE_TP,KNID,EJENDOMS_ID,EJENDOMS_TP, VURD_BLB
    ,VURD_VAKD,VURD_DT,HAIRCUT,SIK_VAKD,SIK_FOER_BLB,HAIRCUT_BLB,FORANST_PRIO_BLB,RETTIGHEDER_BLB,SIK_EFTER_BLB
    ,OVERSKREVET_MK,OVERSKREVET_BLB,MAN_HAIRCUT_BLB,MAN_OBJ_E_HCUT_BLB,GLDER_FRA_DT, TRANSAKTIONS_TP,SIK_STATUS_TP
    FROM
    ETZ3EDW.dbo.EWWH_KS_OBJ_KND2_HV A
    WHERE
    A.SIK_AFTALE_TP = 20130 and A.TRANSAKTIONS_TP not in ('S')
    AND A.GLDER_FRA_DT = ( SELECT MAX(B.GLDER_FRA_DT)
    FROM ETZ3EDW.DBO.EWWH_KS_OBJ_KND2_HV B
    WHERE B.GLDER_FRA_DT <= '2014-01-08'
    AND A.SIK_OBJEKT_ID = B.SIK_OBJEKT_ID
    AND A.SIK_AFTALE_ID = B.SIK_AFTALE_ID)

    Can you show us a execution plan of the query?
    CREATE TABLE #tmp (col DATE)
    INSERT INTO #tmp
    SELECT MAX(B.GLDER_FRA_DT)
    FROM ETZ3EDW.DBO.EWWH_KS_OBJ_KND2_HV BJOIN ETZ3EDW.dbo.EWWH_KS_OBJ_KND2_HV AON A.SIK_OBJEKT_ID = B.SIK_OBJEKT_ID
    AND A.SIK_AFTALE_ID = B.SIK_AFTALE_ID
    WHERE B.GLDER_FRA_DT <= '2014-01-08'SELECT
    SIK_ROLLE_ID,SIK_OBJEKT_ID,SIK_AFTALE_ID,SIK_AFTALE_TP,ROLLE_TP,KNID,EJENDOMS_ID,EJENDOMS_TP, VURD_BLB
    ,VURD_VAKD,VURD_DT,HAIRCUT,SIK_VAKD,SIK_FOER_BLB,HAIRCUT_BLB,FORANST_PRIO_BLB,RETTIGHEDER_BLB,SIK_EFTER_BLB
    ,OVERSKREVET_MK,OVERSKREVET_BLB,MAN_HAIRCUT_BLB,MAN_OBJ_E_HCUT_BLB,GLDER_FRA_DT, TRANSAKTIONS_TP,SIK_STATUS_TP
    FROM
    ETZ3EDW.dbo.EWWH_KS_OBJ_KND2_HV A
    WHERE
    A.SIK_AFTALE_TP = 20130 and A.TRANSAKTIONS_TP not in ('S')
    AND A.GLDER_FRA_DT IN (SELECT col FROM #tmp)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to hide title of the list on Content Query Web Part?

    I am trying to display the description on content query web part from a list. Even when I leave the Title field blank on "Presentation" section (editing the web part), the title shows up with the link along with the description. Is there any way
    to hide the title or leave it as blank? Any help is highly appreciated.
    Thanks,
    Evilar

    Hi Evilar,
    Thanks for posting your issue, Kindly use the below mentioned CSS Style in ID of table tag to fix this issue
    #hide-title .ms-viewheadertr {
    display: none;
    }OR
    For Content Query Web part (WebPartWPQX) Note; X is a number of your web part.#WebPartWPQX .ms-viewheadertr
      display: none;
      }So only titles of the webpart within the WebPartWPQX will be hided.
    Also, browse below mentioned URL for more details
    http://www.balestra.be/2013/08/hide-column-titles-from-sharepoint-lists-libraries.html
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Content By Search Web Part and the Hover Panel

    Hi
     I have an Office 365 E3 account.
    I have a Content By Search Webpart which I have added to a home page.
    I have a display template that displays the results and should show the Search hover panel just like in SharePoint Search Results.
    However, it does not unless the CSWP is near the bottom of the screen.
    I have used the IE11 debugger and I can see the hover panel code being called when the mouse enters the CSWP area, but it only works (and doers not stay visible very long) if the CSWP web part is at the bottom of the screen.
    This only works when the CSWP is at the bottom of the screen.  It does not work when the CSWP is further up the screen.
    Am I doing something wrong.
    (This works perfectly using on-premise SharePoint 2013 with SP1.)
    Regards
    Nigel
    Nigel Price NJPEnterprises

    Hi  Nigel,
    According to your description, my understanding is that the hover panel of your custom display template only works when the Content Search Web Part is at the page bottom.
    For  customizing  hover panel on the Content Search Web Part  using a Custom Display Template, you can refer to the blog:
    http://www.cdhtalkstech.com/2013/11/19/5598/
    I tested it in my SharePoint Online environment and the hover panel worked.
    For more information, you can have a look at these articles:
    http://yeshagrawal.blogspot.in/2013/06/sharepoint-2013-search-adding-hover.html
    Thanks,
    Eric
    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]
    Eric Tao
    TechNet Community Support

  • How to display all the surveys using content query web part

    Can you please tell me how to display all the surveys using content query web part in more details? I also created a subsite and multiple surveys in that site. Then, I inserted a Content Query Web Part and select the List Type to be "Survey",
    however, it returned nothing. Did I miss anything?

    Hi,
    OOTB Survey List does not contain any
    Content Types and it has the following structure:
    Response entry is represented by
    List Item
    Response entry consist of questions and answers, where Question correspond to
    Field and Answer to Item value respectively.
    For querying Survey List via CQWP  the following properties could be used
    BaseType 
    <Lists BaseType="4">
    ServerTemplate
    <Lists ServerTemplate="102">
    Example
    To retrieve all the responses from Survey lists, specify List Type property as shown on picture
    Reference:
    http://stackoverflow.com/questions/17280778/display-all-surveys-using-content-query-web-part
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Content By Search web part causing issue for ajax post back implementation in Anonymous page

    We have recently migrated from SharePoint 2010 to 2013. In our site we have the registration control with ajax update panel which is working fine in all the pages other than home. After analysis, I found that this issue is happening only if the content
    by search web part exists (with loading behaviour as Sync. We tried with Async, ajax postback implementation working fine but search web part need some permission to execute the query in anonymous page).
    We got this link
    http://msdn.microsoft.com/en-us/library/ff650218.aspx which tell to include
    Microsoft.Practices.SPG.AJAXSupport.dll but we can't find this dll for VS 2012. Let us know where we can download the link.

    Hi,
    Here is a similar thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/eb0df77b-6daf-4c63-9f0e-20bd0caae53c/referencing-microsoftpracticesspgajaxsupportdll?forum=sharepointdevelopmentprevious
    If you want to use Microsoft.Practices.SPG.AJAXSupport.dll. We can download the SharePointGuidance-August 2009.exe and install it, then we can find the project in the Source folder.
    Download:
    http://www.microsoft.com/en-us/download/confirmation.aspx?id=13284
    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

  • How to get the SQL Query statement of a Search Form ?

    Hi all,
    We have a requirement to send the query result of an ADF Search Form into report application (Crystal rpt).
    Crystal can accept data source as query statement. SO I think of getting the exact query statement "generated" by the ADF Search form and send it to crystal.
    Is this possible ?
    Thank you very much,
    xtanto

    Try the various get methods of the viewObject such as getQuery:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtAnchor.getQuery%28%29/vtTopicFile.bc4jjavadoc%7Crt%7Coracle%7Cjbo%7CViewObject%7Ehtml/

Maybe you are looking for

  • PDF content disposition on IE

    Hi, I am having difficulties in displaying PDF content from JSP. Obviously URL ends with mypdffile.jsp. From the JSP, I set attributes as follows. It works as intended on Firefox. Not on IE; response.setContentType("application/pdf;charset=UTF-8"); r

  • Best approach for using Faces with growing children?

    Hi all, I'm I recent Aperture user with young kids (four-year old twins), and I'm wondering how best to use Faces to identify the kids' faces.  I started working with about 6 months worth of recent photos in Aperture (3.2.3) before importing my full

  • Installing Adobe Reader on a non-internet connected laptop

    Hi, I'm trying to install Adobe Reader onto a laptop with no internet connections. I have tried downloading the installer from Adobe website and transfer the installer to the laptop via a thumbdrive. I have tried umpteen times and the installing proc

  • Pavilion 25xi Surface Pro 3 Compatability

    I haqve finally commissioned my Surface Pro 3 as my Desktop Solution using Docking Station. I have connected all devices originally attached to my HP Desktop (which used Windows 8.1). I have got everything operating including a Samsung Monitor, but t

  • How to animate a combo box?

    I have a combo box that get's populated from a web service. This may happen in the background as the user is doing other tasks. I would like the combo box to jiggle or bounce up and down when it receives it's data. Can anyone offer some insights into