Blog Archives

Create SharePoint 2016 install package with AutoSPSourceBuilder

Hey Everyone!

Today i will speak about AutoSPSourceBuilder, a great powershell script to create a packages to install SharePoint 2016, 2013 and 2010. The packages created by AutoSPBuilder,  you can use AutoSPInstaller, a greats powershell script to automize the instalation of SharePoint also available for SharePoint version 2016, 2013  and 2010.

I deeply recommend create with this script because the package will include the most recent updates of SharePoint!

Follow the steps below:

  1.  Download SharePoint 2016, you can use the following link:https://www.microsoft.com/en-us/download/details.aspx?id=51493.

2. Download AutoSPSourceBuilder, you can download on github – https://github.com/brianlala/AutoSPSourceBuilder.

3. Mount the .iso image of SharePoint 2016.

4. Run the script – AutoSPSourceBuilder.ps1 with Powershell as admin.

.AutoSPSourceBuilder.ps1 -GetPrerequisites $true

5. The script will start and the firstly  check if exists SharePoint image,  if exists it will create a struct of folders in disk drive c.

6. You need select what is the last update that you what include on your installation package, as SharePoint 2016 updates are cumulative you just need to select the last one.

7. The script continue… and install the prerequisites.

8. Select the language pack that you want include on your installation.

9. Finally the script will finish the package.

10. At the end you have a structure of folders and files that make up your SharePoint package to run in AutoSPInstaller.


Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

 

SharePoint Online, 2013 and 2016 – Display list data in grid using Rest API

Hey Everyone!

Today, in this post i will show you how can we display list data in a grid using Rest API in SharePoint Online, 2013 and 2016.
In this example, i will create a table – Cars – with 4 columns:

– Make
– Model
– Price
– Color

http://span%20style=

$(function(){
    $("#btnClick").click(function(){
        var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Cars')/items";
           $.ajax({
              url: requestUri,
              type: "GET",
              headers: {
                  "accept":"application/json; odata=verbose"
              },
              success: onSuccess,
              error: onError
});

  function onSuccess(data) {
     var objItems = data.d.results;
     var tableContent = '' + '' + '' + '' + '';
  
     for (var i = 0; i '';
         tableContent += '';
         tableContent += '';
         tableContent += '';
         tableContent += '';
         tableContent += '';
 }
   $('#carsGrid').append(tableContent);
   }
    function onError(error) {
        alert('Error');
   }
  });
});


<input type="button" id="btnClick" value="Get All Cars"/>
CustomerPanel">
MakeModelPriceColor
' + objItems[i].Make + '' + objItems[i].Model + '' + objItems[i].Price + '' + objItems[i].Color + '
tableCars' style="width: 100%;" border="1 px">
carsGrid" style="width: 100%">
</td> </tr> </table> </div>

You just need to copy the code and past in a script editor webpart, if you press the button  – Get All Cars –  the result it’s a the following table:

Mark Model Price Color
Mercedes A180 22.000.00€ Red
Jaguar X-Type 72.000.00€ Green
Fiat 500 20.000.00€ Blue
Bmw 320d 32.000.00€ Black

If you are interested to read more, i recommend the following links:
https://msdn.microsoft.com/en-us/library/office/jj860569.aspx
https://msdn.microsoft.com/en-us/library/office/jj164022.aspx

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

Google URL Shortener for SharePoint items

You can shorten URLs to make them easier to share using the Google URL shortener. For example, the short URLhttp://goo.gl/l6MS

This is a good way to share and generate short links to share documents.

1) you need to get the API Key for: https://developers.google.com/url-shortener/

2) Install Google APIs Client Library, using NuGet

googleapi

3) Check all References

shorten

4) Use the following method to generate ShortLink

public static string UrlShorter(string largeUrl)
  {
     var finalUrl = string.Empty;
     var key = "API KEY GOOGLE"
     var post = "{\"longUrl\": \"" + largeUrl + "\"}";
     var request = (HttpWebRequest)WebRequest.Create(
             "https://www.googleapis.com/urlshortener/v1/url?key=" + key);
            try
            {
             request.ServicePoint.Expect100Continue = false;
                request.Method = "POST";
                request.ContentLength = post.Length;
                request.ContentType = "application/json";
                request.Headers.Add("Cache-Control", "no-cache");
                using (var requestStream = request.GetRequestStream())
                {
                    byte[] postBuffer = Encoding.ASCII.GetBytes(post);
                    requestStream.Write(postBuffer, 0, postBuffer.Length);
                }
                using (var response = (HttpWebResponse)request.GetResponse())
                {
                  using (var responseStream = response.GetResponseStream())
                  {
                    if (responseStream != null)
                      using (var responseReader = new StreamReader(responseStream))
                      {
                        var json = responseReader.ReadToEnd();
                        var jss = new JavaScriptSerializer();
                     var dict = jss.Deserialize<Dictionary<string, string>>(json);
                        finalUrl = dict["id"]; 
                      }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
            return finalUrl;
        }

Thanks

SEO – Change Meta Tags Dynamically in SharePoint or Asp.net – (JavaScript & C#) – Google Crawlers

Google-Crawl-Index-550x331

Meta tags are a great way for webmasters to provide search engines with information about their sites. They can be used to provide information to all sorts of clients, and each system processes.

Meta tags are added to the <head> section of your HTML page and you can add them dynamically use JavaScript when page load or using c#:

The following examples explain how can you add it on your header Page:

1. Use c#

public static void ApplyTagsCSharp(string xtitle, string xkeywords, 
string xdescription, Page page)
        {
            page.Title = xtitle;
            ContentPlaceHolder contentPlaceHolder = 
           (ContentPlaceHolder)page.Master.FindControl("PlaceHolderPageTitle");
            contentPlaceHolder.SetRenderMethodDelegate
            (delegate(System.Web.UI.HtmlTextWriter writer,
            System.Web.UI.Control Container)
            {
                writer.Write(xtitle);
            });

            ////Add Keywords Meta Tag
            HtmlMeta keywords = new HtmlMeta();
            keywords.HttpEquiv = "keywords";
            keywords.Name = "keywords";
            keywords.Content = xkeywords;
            page.Header.Controls.Add(keywords);

            //Add Description Meta Tag
            HtmlMeta description = new HtmlMeta();
            description.HttpEquiv = "description";
            description.Name = "description";
            description.Content = xdescription;
            page.Header.Controls.Add(description);
        }

2. Use JavaScript with ClientScriptManager

public static void ApplyTagsJS(string title, string keywords, 
string description, string author, ClientScriptManager csx, System.Type tp)
        {
            String csname2 = "isTagFunction";
            Type cstype2 = tp;

            if (!csx.IsStartupScriptRegistered(cstype2, csname2))
            {
                StringBuilder cstext2 = new StringBuilder();
                cstext2.Append("");
                if (!string.IsNullOrEmpty(keywords))
                {
                    cstext2.Append("$('meta[name=keywords]').remove();");
                    cstext2.AppendFormat("$('head').append( '');", keywords);
                }
                if (!string.IsNullOrEmpty(description))
                {
                    cstext2.Append("$('meta[name=description]').remove();");
                    cstext2.AppendFormat("$('head').append( '' );", description);
                }
                if (!string.IsNullOrEmpty(title))
                {
                  cstext2.AppendFormat("document.title = \"{0}\"; ", title);
                }
                csx.RegisterStartupScript(cstype2, csname2, cstext2.ToString());
            }
        }

Thanks

SharePoint 2016 – Project Template for Visual Studio Available

Microsoft Office Developers Tools for Visual Studio 2015 https://www.microsoft.com/en-us/download/details.aspx?id=49972 includes the templates for developing SharePoint farm and sandboxed solutions for SharePoint 2016.

VSSHP

Before you install,  you need to have Visual Studio 2015 Installed  https://www.visualstudio.com/post-download-vs?sku=community

Thanks

 

 

Collab365 Global Conference Trailer

Improving Workflow Performance – SharePoint 2013

Many times you need  improve the performance of the workflow due to delay in execution, or the email intervals. Whatever the reasons are… , you need to check the four parameters to improve the workflow Performance:


 1 .Increase Throttle size
  • The number of workflows that can be processed concurrently per content database.
  • Default: 15
  • Change using: Set-SPFarmConfig –WorkflowPostponeThreshold 20″ 
  • Or : stsadm -o setproperty -pn workflow-eventdelivery-throttle -pv “20”    

2. Increase Default Batch Size

  • The number of SPWorkItems that the “job-workflow” Timer Job will attempt to complete in one run.
  • Default: 100
  • Change using: Set-SPFarmConfig –WorkflowBatchSize 200
  • Or: stsadm -o setproperty -pn workitem-eventdelivery-batchsize -pv “200”

3. Increase Time out

  • How long the job-workflow Timer Job has to complete its batch before it is forcibly shut down.
  • Default: 5 mins
  • Change using: Set-SPFarmConfig –WorkflowEventDeliveryTimeout 20
  • Or: stsadm -o setproperty -pn workflow-eventdelivery-timeout -pv “10”

4. Increase Workflow Timer Interval

  • How  frequently the job-worflow Timer Job run
  • Default: 5 mins
  • Change using: “Set-SPTimerJob –Identity job-workflow -Schedule  “Every 2 minutes between 0 and 59″”

Office Tools For Visual Sudio 2015 – for SharePoint

If you are new on Visual Studio 2015 and you would like to use it for sharepoint projects you could make the download of Office Tools For Visual Sudio 2015 on the following link:

https://www.visualstudio.com/en-us/features/office-tools-vs.aspx

Thanks

Add a custom content type to a custom list definition

To add a custom content type to a custom list definition , the simple way to do is to add some entries in the schema.xml of the list.

Just add the ContentTypeRef of the contents types you want to use:

  • Add the DisallowContentTypes=”FALSE tag to the Elements.xml for the list;
  • Add the EnableContentTypes=”TRUE tag to the List Definition Schema.xml;

Sometimes i don’t really know the reason but some of the fields are not shown when trying to create a new item in the list.

I solved this problem by copying the field definition in the contents type to the schema.xml of the list. and it works fine.

The advantage of building on top of SharePoint

on: Ignite – 2015