Testing sharepoint search web service using jquery

0 comments
This is a code to test the search web service in SharePoint. Here is the Javascript part
function SoapSearchCaller(){
 var queryXml = "";
    var soapEnv = "";
    
    queryXml = jQuery("#inptextarea").val();
 
 soapEnv += "";
 soapEnv += '';
    soapEnv += '';
    soapEnv += '';
 soapEnv += escapeHTML(queryXml);
    soapEnv += '';
    soapEnv += '';
 soapEnv += '';
 soapEnv += '';

    jQuery.ajax({
        url: "/_vti_bin/search.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: CIToolsProcessResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
};

// process the results from the web service
function CIToolsProcessResult(xData, status) {
 jQuery("#Response").append(""+status+"");    
 jQuery("#Response").append(xData.responseText);    
}; // end of processResult
Here is the HTML part


Submit
-
Clear


Response

Google store in C#?

1 comments
Maybe is a 3rd party store, or really using C#.

Check this url http://www.googlestore.com/category.asp?catid=search&searchtype=keyword&search=blogger

Here is a image of the action


More soap and jquery in sharepoint

0 comments
function CIShowToolsSlider() {
    var soapEnv = " \
         \
             \
                 \
                {F55B5D06-1D32-4DCF-8A83-5BC4BA9FDA20} \
                 \
                 \
                     \
                         \
                         \
                     \
                 \
                1 \
                 \
             \
        ";
    jQuery.ajax({
        url: "/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: CIToolsProcessResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
};

// process the results from the tools web service CIShowToolsSlider()
function CIToolsProcessResult(xData, status) {
    jQuery(xData.responseXML).find("z\\:row").each(function() {
  // location of the div the new items should be appended to
        var url = jQuery(this).attr("ows_URL");
        var title = jQuery(this).attr("ows_Title");

        url = url.substring(0, url.indexOf(','));
        jQuery("#CIToolsDropDownMenu").append("
  • " + title + "
  • "); }); }; // end of processResult

    Filtering sharepoint expiration date with xsl

    0 comments
    To filter expiration date in your xsl xslt using sharepoint:

    
    ...
    
    

    jQuery Shadowbox and Photo Library

    0 comments
    Sorry, I don't have time to write a tutorial, but basically it is the same as the other async calls with jquery. It reads a Photo Library, order by date, populate the "ciPhotoOfTheMonth" DIV and call shadowbox to attach the href tags inside of a DIV to shadowbox

    
    
    
    <link rel="stylesheet" type="text/css" href="/_layouts/js/shadowbox/shadowbox.css">
    
    
    
    
    
    
    
    

    Printing object xmldocument

    0 comments
    To print the "object xmldocument" you can use: alert('responseText: ' + xData.responseText);

    Sharepoint Master page and "save your changes before continuing, click OK. To continue without saving changes, click Cancel" alert

    0 comments
    For some reason some controls in edit mode throws: save your changes before continuing, click "OK". To continue without saving changes, click "Cancel".

    To fix the leave authoring problem in sharepoint you need to add the following tag in the header of your master page:

    <meta equiv="X-UA-Compatible" content="IE=EmulateIE7">

    Explanation about the X-UA-Compatible http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx

    jQuery and Sharepoint web services - add a list item

    0 comments
    This is a very basic tutorial in how to add list items using SharePoint and jQuery. Some prerequisites to understand what is happening. The main items to observe are:
    • xhr.setRequestHeader that you can get from the web services page (see bellow)
    • in the SharePoint' list you need two columns Title and Description
    • the browser alert window will return some information that you could remove after testing
    • after posting the information in the list it will run the processResult function where you can do some fancy user feedback
    
    
    Html with the fields to be edited by the user
    Title: 
    Description: 
    
    
    In the SharePoint web services description you can extract the value for the xhr.setRequestHeader variable invoking /_vti_bin/lists.asmx?op=UpdateListItems, here is an example:
    POST /_vti_bin/lists.asmx HTTP/1.1
    Host: www.ausinnovation.org
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"
    
    
    
    
    
    string
    
    schemaxml
    
    
    
    

    Extreme programming

    0 comments

    Flow charts

    0 comments

    Bug x Feature

    0 comments

    Removing html tags from xml with xslt (aka string html tags with xslt)

    0 comments
    The technique to remove tags from xml with xslt is very creative. If you have a xml document that is like:

    Lorem ipsum dolor sit amet <b> consectetur adipiscing elit </b>. Suspendisse ac ipsum eu orci accumsan dignissim. Fusce fringilla.

    The script will store in the variable the items before the "<" and send to recursion the items after the ">".

    
     
      
       
      
     
     
     
    
    
    
     
     
      
       
       
       
       
        
        
       
      
      
       
      
     
    
    

    Thanks to KaushaL.NET for this xslt code

    Nice brazilian band

    0 comments
    It is a nice brazilian band but do not try to listen them live

    Adding form to content editor web part - cewp

    0 comments
    After a while fighting with forms and content editor web part, I decided to write a jquery script to help with that, basically you replace the form with div and the script will generate a new form when the user submit. You can check out the code here: jquery sharepoint form

    Sharepoint link in XSLT - FileRef

    0 comments
    For some reason SharePoint translate your FileRef links in XSLT when you use the data view web part, content query web part, or any other XSL in SharePoint. It translates to the library link. To fix it, you have to use the xsl:attribute. Example:
    
      
        
      
      
      
      
       
    

    Dilberts

    0 comments
    Dilbert and user interface

    Dilbert and incompetenc

    Dilbert and technical manual

    replace space in the filenam in linux using mv

    0 comments
    To replace the space in the middle of the filename in linux you can use "mv"
    for f in *; do file=$(echo $f | tr A-Z a-z | tr ' ' _) [ ! -f $file ] && mv "$f" $file done
    

    Gathering requirements

    0 comments

    jquery .text garbage bug

    0 comments
    There is a small bug in IE that makes $.text() return garbage text at end, in case you have a bug that you cannot nail down, debug the problem using: alert(encodeURIComponent($.text(...))); that will show any hidden character. More information about encodeURIComponent: http://xkr.us/articles/javascript/encode-compare/