Friday, September 23, 2016

Generate WSDL FROM salesforce system and How to convert WSDL file to class file

LOGIN to Salesforce

On right side 
Click on setup




then Search for API in search tab

Click on Generate enterprise wsdl 

Then its generates the wsdl and copy and paste it notepad

Save As "SDFC.wsdl"

How to convert WSDL file to class file

  1. In Solution Explorer right click on your project and go to "Add Service Reference..."
  2. Press "Advanced..." at the bottom of the window.
  3. Press "Add Web Reference..." at the bottom of the window.
  4. In the URL field enter the path to the file eg. C:\Documents and Settings\username\Desktop\filename
  5. Press Go arrow. Service description should display.
  6. Enter the reference name you wish.
  7. Press "Add reference".
  8. Watch Visual Studio do its magic and making your life easy.
  9. Take a break.



Thursday, September 22, 2016

Renamed Project, WSP name doesn't change

changed project name, still i'm getting wsp name visual studio

Open The Package.Package file and change then Name attribute.
Example
<package xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" 
dslVersion="1.0.0.0" Id="d3150724-5644-479c-99f3-fc99af5bfdc6" 
solutionId="d3150724-5644-479c-99f3-fc99af5bfdc6" resetWebServer="true" 
sharePointProductVersion="15.0"
name="NEWNAME" 
xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/PackageModel">

Thursday, May 12, 2016

SharePoint 2013: Showing Page Views within a SharePoint Page


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
    var clientContext;
    var siteCollection;
    var hitCount='';
    var siteCollUrl = '';
    var webHost = '';
    var isIE = false;
    var siteUrl = '';
    var date = '';
    var uname = '';
    var hitCountplaceholder = '#hitCountplaceholder';
    var listName = 'Statistics';
 
    $(document).ready(function () {
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
            $(hitCountplaceholder).html('Count: ');
            SetPageVisitCount();
        });
    });

    function showProperties() {
        if (msieversion()) {
            alert($.browser.version);
            siteCollUrl = _spPageContextInfo.siteAbsoluteUrl + "/";
            webHost = siteCollUrl;
        }
        else {
            siteCollUrl = _spPageContextInfo.siteAbsoluteUrl;
            webHost = siteCollUrl + "/";
            alert(siteCollUrl);
        }

        SetPageVisitCount();
    }
    function SetPageVisitCount() {
        siteUrl = _spPageContextInfo.siteAbsoluteUrl;
        date = new Date();
        console.log(date);
        clientContext = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl);
        uname = clientContext.get_web().get_currentUser();
        clientContext.load(uname);
        var oList = clientContext.get_web().get_lists().getByTitle(listName);
        var itemCreateInfo = new SP.ListItemCreationInformation();
        this.oListItem = oList.addItem(itemCreateInfo);
        oListItem.set_item('Title', 'No Title');
        oListItem.set_item('url', siteUrl);
        oListItem.set_item('date', date);
        oListItem.set_item('uname', uname);
        oListItem.update();
        clientContext.load(oListItem);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    }

    function onQuerySucceeded() {
        // alert('Item created: ' + oListItem.get_id());
        hitCount = oListItem.get_id();
        $(hitCountplaceholder).append(hitCount);
    }

    function onQueryFailed(sender, args) {
        console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    }

    function GetPageVisitCount() {
        appendString = '';
        $(hitCountplaceholder).append(appendString);
    }
</script>
<div id="hitCountplaceholder"></div>


MORE REFERENCES

http://spdeveloper.co.in/sharepoint2013/page-views-hit-counter-on-a-sharepoint-page.aspx


Thursday, April 28, 2016

Image Slider - SharePoint Picture lilbrary using jquery.bxslider.js

Image Slider - SharePoint Picture lilbrary using jquery.bxslider.js

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="/sites/eDMS/Style%20Library/ImageCarousel/jquery.bxslider.js"></script><link href="/sites/eDMS/Style%20Library/ImageCarousel/jquery.bxslider.css" rel="stylesheet" runat="server" />
<script type="text/javascript">
    var clientContext;
    var siteCollection;
    var imgLoc
    var appendString = '';
    var totalSiteCount = 0;
    var siteCount = 0;
    var asyncCallbacks = [];
    var siteCollUrl = '';
    var webHost = '';
    var isIE = false;

    $(document).ready(function () {
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
            $("#sliderplaceholder").html('');
            showProperties();
        });
    });

    function showProperties() {
        if (msieversion()) {
            //alert($.browser.version);
            siteCollUrl = _spPageContextInfo.siteAbsoluteUrl + "/";
            webHost = siteCollUrl ;
        }
        else {
            siteCollUrl = _spPageContextInfo.siteAbsoluteUrl;
            webHost = siteCollUrl + "/";
        }

        getWebPartProperties('Local');
    }

    function msieversion(str) {

        var ua = window.navigator.userAgent;
        var msie = ua.indexOf("MSIE ");

        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))  // If Internet Explorer, return version number
        {
            //alert(parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))));
            //return true;
            isIE = true;
            return true;
        }
        else  // If another browser, return 0
        {
            //alert('otherbrowser');
        }

        return str;
    }

    function getWebPartProperties(imageLoc) {

        switch (imageLoc) {

            case 'Local':
                clientContext = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl);
                this.oSite = clientContext.get_site();
                this.oWebsite = this.oSite.get_rootWeb();
                this.list = this.oWebsite.get_lists().getByTitle("AAGBanners");
                var query = "<View><Query><Where><Eq><FieldRef Name='Region' /><Value Type='Choice'>CoastalMarine</Value></Eq></Where></Query><ViewFields><FieldRef Name='BannerLinkURL' /><FieldRef Name='FileRef' /><FieldRef Name='Title' /></ViewFields></View>";
                var camlQuery = new SP.CamlQuery();
                camlQuery.set_viewXml(query);
                this.productcollection = this.list.getItems(camlQuery);

                clientContext.load(this.productcollection, 'Include(BannerLinkURL, Title, FileRef)');
                clientContext.executeQueryAsync(Function.createDelegate(this, function () {
                    var appendString = "<ul class='bxslider'>";
                    console.log('hi');
                    var ListEnumerator = this.productcollection.getEnumerator();

                    while (ListEnumerator.moveNext()) {
                        var currentItem = ListEnumerator.get_current();

                        if (currentItem.get_item('FileRef') != null) {
                            console.log(currentItem.get_item('FileRef'));
                            //alert(currentItem.get_item('ImageURL'));
                            var url = $("<a href='" + currentItem.get_item('FileRef') + "'>").prop("pathname");
                            if (isIE)
                                url = url.substr(1, url.length);
                            appendString += "<li style='position: absolute; top: 0px; z-index: 5; display: block;'><a href='" + currentItem.get_item('BannerLinkURL') + "'><img  src='" + url + "' title='" + currentItem.get_item('Title') + "' width='100%' height='284px' /></a></li>";
                        }
                    }
                    console.log(appendString);
                    appendString += "</ul>"
                    $("#sliderplaceholder").append(appendString);
                    invokeSlider();
                    //alert("Success");
                }), Function.createDelegate(this, function (sender, args) {
                    console.log(args.get_message());
                }));
                break;
        }
    }

    function invokeSlider() {
        /*$('.bxslider').bxSlider({
          captions: true
        });*/
        $('.bxslider').bxSlider({
            mode: 'fade',
            infiniteLoop: true,
            slideWidth: 600,
            auto: true,
            autoStart: true,
            autoDirection: 'next',
            adaptiveHeight: false,
            autoHover: true,
            pause: 3000,
            autoControls: false,
            pager: true,
            pagerType: 'full',
            controls: true,
            captions: true,
            speed: 500
        });
    }
</script>
<div id="sliderplaceholder"></div>

Friday, April 15, 2016

cd workingcopy
svn checkout http://my.repos.com/path/to/trunk
# make your edits
svn switch http://my.repos.com/path/to/branch
svn commit


Tuesday, April 5, 2016

export search results to a excel OOTB

export search results to a excel OOTB


Refinement panel how the modified date is coming up. Can we give a range

Modified date is coming  just like a time period, such as one year ago,  Month ago, Week ago, and Today... we can change an bit on this.

As per analysis,  refinement panel to have date range,  there is no OOTB method to achieve this  requirement.  The refinement panel cannot have the controls. We can create a custom search web part which can take inputs from user and do the search.


Wednesday, March 16, 2016

Custom entity extraction in SharePoint 2013

Create and deploy custom entity extractors in SharePoint Server 2013

  • Create a Search service application
  • Add one or more content sources and run a full crawl
  • Configure a search results page
Follow these two links

https://technet.microsoft.com/en-IN/library/jj219480.aspx

http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/01/08/no-metadata-no-problem-custom-
entity-extraction-in-sharepoint-2013.aspx

Thursday, October 1, 2015

Exposing WCF REST Service over BasicAuthentication

<system.serviceModel>
  <behaviors>
      <serviceBehaviors>
        <behavior name="MyServiceServiceBehavior">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        
        </behavior>
     
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="jsonBehaviour">
          <webHttp automaticFormatSelectionEnabled="true"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
<bindings>
    <webHttpBinding>
        <binding name="BasicAuthentication">
            <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Basic" />
            </security>
        </binding>
    </webHttpBinding>
</bindings>
    <services>
      <service name="Cadence.SP.COS.Services.QueryService" behaviorConfiguration="MyServiceServiceBehavior">
       <endpoint address="" bindingConfiguration="BasicAuthentication" binding="webHttpBinding" behaviorConfiguration="jsonBehaviour" contract="Cadence.SP.COS.Services.IQueryService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">
        </endpoint>
      </service>
      </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

  </system.serviceModel>


How to Deploy Your HTML Website on a Linux Server (Apache + SFTP)

Launching a simple HTML website on your own Linux server is easier than you might think. Whether you're sharing a static landing page or...