Tag Archives: great sharepoint 2013 hosting

SharePoint 2013 Hosting :: How to Create Site Creation App in SharePoint 2013

Today we will learn step by step how to create site creation app in SharePoint 2013.

ahp banner sharepoint-01

In SharePoint Server 2013, a Site Creation App allows an option to the users to create a site even if the user has no permission to create a site from a web template that we can configure either custom or OOTB. For example, if we use SharePoint as a social platform and use community sites and community portalm then we can provide an option to user this app where the user can create a community site (site template will be configured in app code).

Prerequisites for setting up your development environment to work with a Site Creation App

To create the SharePoint Hosted App that uses the JavaScript object model to work with a Site Create App, you’ll need:

  • Visual Studio 2012
  • App Configuration in server
  • Local administrator permissions for the logged-on user

Create a farm solution and SharePoint-Hosted App

Use the following procedure to create a farm solution and SharePoint-Hosted App in Visual Studio 2012:

  • Run Visual Studio as administrator, and choose “File” -> “New” -> “Project…”.
  • In the New Project dialog box, choose “.NET Framework 4.5″ from the drop-down list at the top of the dialog box.
  • In the Templates list, expand “Office/SharePoint”, choose “Apps”, and then choose the “App for SharePoint 2013″ template.
  • Name the project “SiteApp”, and then choose the “OK” button.
  • In the SharePoint Customization Wizard dialog box, choose “Deploy as a farm solution” and then choose the “Finish” button.
  • In Solution Explorer, open the shortcut menu for the SiteApp project, and expand the Pages folder and click on the default.aspx page.
  • In the markup of the “Default.aspx” file, paste the following code between the “Main” asp:Content tags. This code defines controls and script references.

HTML

<div>
Site Name: <inputtype=”text”id=”siteName”value=””/>
<inputtype=”button”onclick=”createSite()”name=”Create”value=”Create”/>
</div>

  • Open the “App.js” file under the Script folder. Replace with the following code:

function getQueryStringValue(key) {
    var returnValue = “”;
    var params = document.URL.split(“?”)[1].split(“&”);
    var strParams = “”;
    for (var i = 0; i < params.length; i = i + 1) {
        var singleParam = params[i].split(“=”);
        if (singleParam[0] === key) {
            return decodeURIComponent(singleParam[1]);
            break;
        }
    }

    return returnValue;
}
function createSite() {

    var hostWebUrl = getQueryStringValue(“SPHostUrl”);
    spcontext = new SP.ClientContext.get_current();
    //then use the host web URL to get a parent context -this allows us to get data from the parent
    parentCtx = new SP.AppContextSite(spcontext, hostWebUrl);
    currentWeb = parentCtx.get_web();

    context.load(currentWeb);
    context.executeQueryAsync(onCreationSuccess, OnFailure);
}

function onCreationSuccess() {
    //alert(“In onCreationSuccess”);
    var appInstanceID = currentWeb.get_appInstanceId();
    var webCreateInfo = new SP.WebCreationInformation();
    webCreateInfo.set_description(“This site created from Javascript”);
    webCreateInfo.set_language(1033);
    var site = $(“#siteName”).val();
    webCreateInfo.set_title(site);
    webCreateInfo.set_url(site);
    webCreateInfo.set_useSamePermissionsAsParentSite(true);

    webCreateInfo.set_webTemplate(“COMMUNITY#0″);// you can add webtemplate as per your choice
    web = currentWeb.get_webs().add(webCreateInfo, false, appInstanceID);

    context.load(web);
    context.executeQueryAsync(onSuccess, OnFailure);

}

function onSuccess() {
    alert(“Web created”);
}
function OnFailure(sender, args) {
    alert(args.get_message());
}

  • Open the “AppManifest.xml” file and set the permission to “Site Collection as Full Control”
  • To test the solution, on the menu bar, choose “Deploy”.

I hope you like my article .. Happy coding :)

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

 

 

SharePoint 2013 Hosting – ASPHostPortal.com :: Deploy SharePoint 2013 Show Template via Visual Studio

We create more and more display templates as soon as we utilize Content By Search Webpart or Search Result Webpart in SharePoint 2013. The recent project that I’ve done includes authoring (internal) site and publishing (external) site through Cross Site Publishing. Since the publishing site is customer facing / external site, we use display templates heavily and I think we have around 90 display templates.

ahp banner sharepoint-01In this article, I would like to show you how to deploy them through Visual Studio. Without further ado, I want to show you my very basic display template:

<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
    <title>My Custom Item Template</title>
 
    <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>
    <mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
    <mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title', 'ListItemID':'ListItemID', 'owstaxIdCNPKeywords':'owstaxIdCNPKeywords'</mso:ManagedPropertyMapping>
    <mso:MasterPageDescription msdt:dt="string">This Item Display Template will show a small thumbnail icon next to a hyperlink of the item title, with an additional line that is available for a custom managed property.</mso:MasterPageDescription>
    <mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
    <mso:TargetControlType msdt:dt="string">;#Content Web Parts;#</mso:TargetControlType>
    <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
    <mso:CrawlerXSLFile msdt:dt="string">/_catalogs/masterpage/MyDisplayTemplates/Server_MyItem.xsl, /_catalogs/masterpage/MyDisplayTemplates/Server_MyItem.xsl</mso:CrawlerXSLFile>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
</head>
 
<body>
    <div>
        <!--#_
                var title = $getItemValue(ctx, "Line 1");
                var itemURL = $getItemValue(ctx, "Link URL");
        _#-->
        <a class="mydiv" data-item="_#= $htmlEncode(itemURL) =#_">_#= $htmlEncode(title) =#_</a>
    </div>
</body>
</html>

As you noticed above, I’ve specified CrawlerXSLFile property. Basically this is required for Search Engine Optimization, to allow search crawler to crawl content inside your Content By Search Webpart/ Search Result Webpart. You could read great post from Waldek here. This is same thing like we did when we would like to customize Content Query Webpart in SharePoint 2010.

<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:ddwrt='http://schemas.microsoft.com/WebParts/v2/DataView/runtime'>
    <xsl:template match='/'>
        <xsl:apply-templates />
    </xsl:template>
 
    <xsl:template match='ResultTable'>
        <xsl:apply-templates select='Rows'/>
    </xsl:template>
 
    <xsl:template match='Rows'>
        <xsl:apply-templates select='Row' />
    </xsl:template>
 
    <xsl:template match='Row'>
        <xsl:for-each select='*'>
            <xsl:if test="name(.) = 'title'">
               <xsl:value-of select="." />
            </xsl:if>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

Now, it come to the deployment part in Visual Studio. Below is the list of steps:
1. Open Visual Studio and Create SharePoint Empty Project as Farm Solution
2. Add New Module, called it DisplayTemplates
3. Add your .html and .xsl display templates into DisplayTemplates Module
4. Edit Elements.xml in DisplayTemplates module

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="DisplayTemplates" Url="_catalogs/masterPage">
    <File Path="DisplayTemplates\MyItem.html" Url="MyDisplayTemplates/MyItem.html" ReplaceContent="True" Type="GhostableInLibrary" Level="Published"/>
    <File Path="DisplayTemplates\Server_MyItem.xsl" Url="MyDisplayTemplates/Server_MyItem.xsl" Type="GhostableInLibrary" Level="Published" ReplaceContent="TRUE"  />
  </Module>
</Elements>

5. Ensure Display Template Module included in your Feature

1fbnytm6. Add Feature Receiver

using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Utilities;
using System;
using System.Runtime.InteropServices;
using System.Xml;
 
namespace DisplayTemplatesDemo.Features.Feature1 {
    /// <summary>
    /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
    /// </summary>
    /// <remarks>
    /// The GUID attached to this class may be used during packaging and should not be modified.
    /// </remarks>
 
    [Guid("4d50c166-1095-4d7c-a4c1-61b35687cbf5")]
    public class Feature1EventReceiver : SPFeatureReceiver {
        /// <summary>
        /// Feature activated, we just change the item title of display template to force SharePoint generates the associated .js file
        /// </summary>
        /// <param name="properties"></param>
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            try {
                var site = (SPSite)properties.Feature.Parent;
                var web = site.RootWeb;
 
                //get all display templates
                string allDisplayTemplates = getAllDisplayTemplates(site.RootWeb, properties.Definition);
                //get the master pages gallery
                var gallery = web.GetCatalog(SPListTemplateType.MasterPageCatalog);
 
                foreach (var displayTemplate in allDisplayTemplates.Split(new char[] {','}))
                {
                    var url = SPUtility.ConcatUrls(gallery.RootFolder.Url, "CNPGallery/Display Templates");
                    url = SPUtility.ConcatUrls(url, displayTemplate);
                    //get the file
                    var fileOrFolder = web.GetFileOrFolderObject(url);
 
                    if (fileOrFolder != null && fileOrFolder is SPFile) {
                        var file = (SPFile)fileOrFolder;
                        if (file.Exists) {
                            //determine if the gallery requires files to be checked out before editing
                            //if so, check this one out
                            if (gallery.ForceCheckout)
                                file.CheckOut();
 
                            //make a simple change
                            file.Item["Title"] = (file.Item.Title != null ? file.Item.Title : displayTemplate);
                            file.Item.Update();
 
                            //if check out required, check it in
                            if (gallery.ForceCheckout)
                                file.CheckIn(string.Empty);
                            //if the gallery has minor versioning enabled, publish a major
                            if (gallery.EnableMinorVersions)
                                file.Publish(string.Empty);
                            //if the gallery required approval, approve it
                            if (gallery.EnableModeration)
                                file.Approve(string.Empty);
                        }
                    }
                }
            }
            catch (Exception ex) {
                //deactivate the feature
                var site = (SPSite)properties.Feature.Parent;
                site.Features.Remove(properties.Feature.DefinitionId);
 
                SPUtility.TransferToErrorPage(ex.Message);
            }
        }
 
        private string getAllDisplayTemplates(SPWeb web, SPFeatureDefinition definition)
        {
            string result = string.Empty;
            try
            {
                string wpcatalogUrl = SPUrlUtility.CombineUrl(web.Url, "_catalogs/masterpage");
 
                // Get the Feature.xml for the feature
                XmlDocument featureXml = new XmlDocument();
                featureXml.LoadXml(definition.GetXmlDefinition(web.Locale).OuterXml);
 
                XmlNamespaceManager nsMgr = new XmlNamespaceManager(featureXml.NameTable);
                nsMgr.AddNamespace("sp", "http://schemas.microsoft.com/sharepoint/");
 
                // Get Location attribute of each ElementManifest inside ElementManifests inside the Feature
                foreach (XmlNode locationNode in featureXml.SelectNodes("/sp:Feature/sp:ElementManifests/sp:ElementFile/@Location", nsMgr))
                {
                    if (result != string.Empty)
                        result += ",";
                    result += locationNode.Value.Replace("Templates\\", string.Empty);
                }
            }
            catch(Exception ex)
            {
                result = string.Empty;
            }
            return result;
        }
    }
}

7. Finally the solution look like below

2frbrtnty8. Build and Deploy the solution

Best SharePoint 2013 Hosting

ASPHostPortal.com  is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.

SharePoint 2013 Hosting :: How To Versioning Settings in SharePoint Office 365 and SharePoint 2013

ahp banner sharepoint-01This article will explains how to describes the Versioning Settings in SharePoint Office 365 and SharePoint 2013. Let’s see in this article what versioning offers to us as a user or developer. Versioning is very important for our document libraries. It not only helps in knowing the number of times an item has been modified but also helps when we actually loose data in our files.

Versioning Settings

draft item security

Content Approval

Here we have an option for specifying whether you want to require a content approval for a submitted item. Some libraries contain sensitive information that needs to be protected. We will not always want all the documents uploaded to the library to be visible to all users. For that we have an option where, when you select this option for the library, when a user uploads a document it goes to the moderator that can review and approve the items or files before the content becomes visible to most site users. The moderators can apply a significant level of quality and security to the content in the lists and libraries.

content approve

  • Document Version History
    Here we have an option for assigning versions to whenever our documents are uploaded and modified thereafter.
    We have:

    1. No Versioning: Option if you don’t want versioning.
    2. Create Major Versions: If you select this option, the versions will be created on whole numbers, for example version 1.0, 2.0, 3.0 and so on.
    3. Create Major and minor(draft) versions: If you select this option, the versions will be created as major versions for published documents and minor versions for draft versions as 1.1 and 1.2 and so on.

    Next we have an option to control the number of versions as in the following:

    1. Keep the following number of versions: Here you can assign a number as to until what number of versions the documents should be stored for that specific item.
    2. Keep drafts for the following number of major versions: Here you can assign a number to limit the number of versions of draft items in the library.document version history
  • Draft Item Security
    Drafts versions are items that have not been approved so here you can control the view of those items in your library, in other words who should see them. So, we have options like:

    1. Any user who can read items: users who will have read access also.
    2. Only users who can edit items: users who will have contribute access.
    3. Only users who can approve items (and the author of the item).draft item security in sharepoint
  • Require Check Out
    This option, when selected, will make it mandatory for the users to check out the item before they edit the item.require check out
    I hope this article helpful.

No#1 Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com  is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.

SharePoint 2013 – ASPHostPortal.com :: Workflow Manager Installation and Configuration

SharePoint 2013 introduced a brand new way of workflow management. Now workflow could be hosted in separate server – so scalable and reduces load on SharePoint Net Front End server. Nevertheless this introduce a new level of complexity that we need to be conscious of.

ahp_freehostSHP(1)

To utilize a windows server as workflow manager you have to install/configure Workflow Manager inside the windows server. Workflow manager is a new form of application server that host/manage workflow execution. SharePoint 2013 workflow is primarily based on .net framework 4.0. Workflow Manager is designed with Window Azure hosting in mind, but now it supports on-premise installation. If organizations now want to host the workflow on-premise they could still use Workflow Manager but in future if they desire to move to Windows Azure hosting for their workflow, the migration will likely be smoother with this Workflow Manager.

Before start installing/developing SharePoint Manager you need to know few points:

  • You should not use SharePoint ‘system account’ to test workflow. If you use ‘system account’ to develop/run workflow, the workflow will fail to run.
  • You need to make sure User Profile Service (UPS) is running and the user who is running workflow has profile in UPS. Workflow Manager use UPS under the hood.
  • Make sure App Management Service is created and running. You don’t need to configure SharePoint 2013 App settings in the server, just creating App Management service (with proxy) will do.
  • SharePoint 2013 workflow is declarative – means you can only define workflow in XML. You can’t write any C# code inside workflow as you used to do before. All your custom logic should be put outside of SharePoint, inside WCF Service. Then you will call the service from workflow to implement your custom logic in code.

To register workflow Server with SharePoint, a SharePoint site collection URL is provided (see the section Register Workflow Service with SharePoint later in the post). Apparently it seems, each and every site collection need to be registered with workflow server. But it’s not, registering a single SharePoint site  collection, will enable workflow manager for all SharePoint web applications/site collections.

Install/Configure Workflow Manager

The first step in workflow setup/configuration is to install workflow manager in the workflow server (either Web Front End or a separate server). To install the workflow Manager download it from Microsoft Site or alternatively you can download it from Web Platform Installer. The installation contains few components:

  • Workflow Manager: This is the host that runs workflows.
  • Workflow Manager Client: It contains the API to allow clients to communicate with Workflow host.
  • Workflow Tool: It needs to be installed in the development server to develop SharePoint 2013 workflow. It supports the workflow development in Visual Studio 2012.

Workflow Manager client needs to be installed in every SharePoint WFE server.

After installing Workflow Manger, you can configure workflow manager with Workflow Manager Configuration Wizard. The configuration involves two steps: Workflow Manager Configuration and Service Bus Configuration.

  • Workflow Manger Configuration (first step in the wizard) is the configuration related to work host server
  • Service Bus configuration (second step in the wizard): Service Bus is used to manage communication between Workflow Server and it’s client (so, SharePoint). Service Bus queues the income request to workflow manage, provide REST interface for Workflow Manager etc.

In workflow configuration wizard don’t use any admin or SharePoint setup user, create a new service user for workflow and use that user:

1fhbeneIf you want SharePoint Server to communicate with Workflow Server over HTTP, you can select the option shown below. But please make sure this is secure in your case. For public site, this might not be secure but in case of Local Intranet with firewall, this might be secure.

2regerhIf you want to use the same service account (as well as auto generated key for certificate), you can use so as shown below:

3grfmrmrIf you want to use the same service account (as well as auto generated key for certificate), you can use so as shown below:

Register Workflow Service with SharePoint

Once you have installed/configured Workflow Server, you need to register the workflow service to SharePoint Server. The registration depends on how the SharePoint and Workflow server is connected to each other. You can find more details at technet site. The workflow manager creates an HTTPS endpoint at port 12291 and HTTP port at 12290. If you use HTTP for communication you need to provide ‘AllowOAuthHttp’ switch in the PowerShell command. The PowerShell command looks like below:

Communication over HTTP

Register-SPWorkflowService –SPSite http://sharepointsite –WorkflowHostUri http://workflowhost:12291 –AllowOAuthHttp

Communication over HTTPS

Register-SPWorkflowService –SPSite http://sharepointsite –WorkflowHostUri https://workflowhost:12290

PowerShell Script to Install/Configure Workflow Manager

I have modified the wizard-generated PowerShell script a bit to make it more reusable. The Script reads configuration values from xml file and apply the configuration. The script uses auto-generate key for certificate. Also the database name are hard-coded in the script, but you can add prefixes (like dev, test, prod) to the database from xml file. The script also configure App Management Service, if the service is not already created. The sample PowerShell Script is provided below:

#Get current user full login name
$CurrentUserLoginName=[Environment]::UserName + '@' + [Environment]::UserDomainName;
#Get current server fully qualified domain name
$HostFQDN="$env:computername.$env:userdnsdomain";

#Load SharePoint Snapin
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ){  
    Add-PsSnapin Microsoft.SharePoint.PowerShell
}

#Get DB Connection String
function GetDBConnectionString([string]$connectionStringFormat, [string]$dbPrefix, [string]$dbName){
    if($dbPrefix -ne ""){
        $dbFullName=$(GetDBName $dbPrefix $dbName);
        return [string]::Format($connectionStringFormat,$dbFullName);
        }
    else {
        return $dbName;
    }
}

#Add Dev, Test etc. environment prefix, if needed
function GetDBName([string]$dbPrefix,[string]$dbName){
    if(($dbPrefix) -and ($dbPrefix -ne "")){
        return $dbPrefix + "_" + $dbName;
    }
    return $dbName;
}

#Get current Script directory
function Get-ScriptDirectory
{
  $Invocation = (Get-Variable MyInvocation -Scope 1).Value
  Split-Path $Invocation.MyCommand.Path
}

function ConfigureWFManager([string]$settingsFile){
    [xml]$wfsettings = Get-Content $settingsFile
    $settings=$wfsettings.Settings;
    $SharePointSiteUrl=$settings.SiteUrl;
    $dbPrefix=$settings.DBPrefix;
    $CertificateKey=$settings.CertificationKey;
    $databaseServer=$settings.DBServer;
    $ConnectionStringFormat="Data Source=$databaseServer;Initial Catalog={0};Integrated Security=True;Encrypt=False";
    $RunAsAccount=$settings.WFManagerRunAsUser;
    $RunAsPasswordPlain=$settings.WFManagerRunAsPassword
    $WorkflowNamespace=$settings.WorkflowNamespace;
    if(ShouldIProvision($settings.AppManagementService))
    {
        ProvisionAppManagementService($settings);
    }

    # To be run in Workflow Manager PowerShell console that has both Workflow Manager and Service Bus installed.
    # Create new Service Bus Farm
    $SBCertificateAutoGenerationKey = ConvertTo-SecureString -AsPlainText  -Force  -String $CertificateKey -Verbose;

    New-SBFarm -SBFarmDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'SBManagementDB')  -InternalPortRangeStart 9000 -TcpPort 9354 -MessageBrokerPort 9356 -RunAsAccount $RunAsAccount -AdminGroup 'BUILTIN\Administrators' -GatewayDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'SBGatewayDB') -CertificateAutoGenerationKey $SBCertificateAutoGenerationKey -MessageContainerDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'SBMessageContainerDB') -Verbose;

    # To be run in Workflow Manager PowerShell console that has both Workflow Manager and Service Bus installed.

    # Create new Workflow Farm
    $WFCertAutoGenerationKey = ConvertTo-SecureString -AsPlainText  -Force  -String $CertificateKey -Verbose;


    New-WFFarm -WFFarmDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'WFManagementDB') -RunAsAccount $RunAsAccount -AdminGroup 'BUILTIN\Administrators' -HttpsPort 12290 -HttpPort 12291 -InstanceDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'WFInstanceManagementDB') -ResourceDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'WFResourceManagementDB') -CertificateAutoGenerationKey $WFCertAutoGenerationKey -Verbose;

    # Add Service Bus Host
    $SBRunAsPassword = ConvertTo-SecureString -AsPlainText  -Force  -String $RunAsPasswordPlain -Verbose;


    Add-SBHost -SBFarmDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'SBManagementDB') -RunAsPassword $SBRunAsPassword -EnableFirewallRules $true -CertificateAutoGenerationKey $SBCertificateAutoGenerationKey -Verbose;

    Try
    {
        # Create new Servie Bus Namespace
        New-SBNamespace -Name $WorkflowNamespace -AddressingScheme 'Path' -ManageUsers $RunAsAccount,$CurrentUserLoginName -Verbose;

        Start-Sleep -s 90
    }
    Catch [system.InvalidOperationException]
    {
    }

    # Get Service Bus Client Configuration
    $SBClientConfiguration = Get-SBClientConfiguration -Namespaces $WorkflowNamespace -Verbose;

    # Add Workflow Host
    $WFRunAsPassword = ConvertTo-SecureString -AsPlainText  -Force  -String $RunAsPasswordPlain -Verbose;


    Add-WFHost -WFFarmDBConnectionString $(GetDBConnectionString $connectionStringFormat $dbPrefix 'WFManagementDB') -RunAsPassword $WFRunAsPassword -EnableFirewallRules $true -SBClientConfiguration $SBClientConfiguration -EnableHttpPort  -CertificateAutoGenerationKey $WFCertAutoGenerationKey -Verbose;

    Write-Host "Registering workflow host (HTTP) to site: $SharePointSiteUrl";
    Register-SPWorkflowService –SPSite $SharePointSiteUrl –WorkflowHostUri $("http://$HostFQDN" + ":12291") –AllowOAuthHttp
}

function ProvisionAppManagementService([System.Xml.XmlNode] $settings){

    $appManagementServices=Get-SPServiceApplication | Where-Object { $_.GetType().ToString() -eq "Microsoft.SharePoint.AppManagement.AppManagementServiceApplication"}
     If($appManagementServices -ne $null)
     {
         Write-Host "An App Managemetn service is already running. Returning.." -ForegroundColor Yellow
        return;
     }    
    
    Write-Host "Provisioning App Management Service";
    $appManagementService=$settings.AppManagementService;
    $appPool=$(GetAppPool $appManagementService)
    $dbName=$(GetDBName $settings.DBPrefix $appManagementService.DBName);
    $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPool -Name $appManagementService.Name -DatabaseName $dbName
    New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
}

function GetAppPool([System.Xml.XmlNode] $appManagementService){
    $pool = Get-SPServiceApplicationPool -Identity $AppManagementService.AppPoolName -ErrorVariable err -ErrorAction SilentlyContinue
    If ($err) {
        # The application pool does not exist so create.
        Write-Host -ForegroundColor White " - Getting $($appManagementService.ManagedAccountUserName) account for application pool..."
        $managedAccount = (Get-SPManagedAccount -Identity $appManagementService.ManagedAccountUserName -ErrorVariable err -ErrorAction SilentlyContinue)
        If ($err) {
            If (($appManagementService.ManagedAccountPassword -ne "") -and ($appManagementService.ManagedAccountPassword -ne $null)) 
            {
                $appPoolConfigPWD = (ConvertTo-SecureString $appManagementService.ManagedAccountPassword -AsPlainText -force)
                $accountCred = New-Object System.Management.Automation.PsCredential $appManagementService.ManagedAccountUserName,$appPoolConfigPWD
            }
            Else
            {
                $accountCred = Get-Credential $appManagementService.ManagedAccountUserName
            }
            $managedAccount = New-SPManagedAccount -Credential $accountCred
        }
        Write-Host -ForegroundColor White " - Creating applicatoin pool $($appManagementService.AppPoolName)..."
        $pool = New-SPServiceApplicationPool -Name $appManagementService.AppPoolName -Account $managedAccount
    }
    return $pool;
}

Function ShouldIProvision([System.Xml.XmlNode] $node)
{
    If (!$node) {Return $false} # In case the node doesn't exist in the XML file
    # Allow for comma- or space-delimited list of server names in Provision or Start attribute
    If ($node.GetAttribute("Provision")) {$v = $node.GetAttribute("Provision").Replace(","," ")}
    ElseIf ($node.GetAttribute("Start")) {$v = $node.GetAttribute("Start").Replace(","," ")}
    ElseIf ($node.GetAttribute("Install")) {$v = $node.GetAttribute("Install").Replace(","," ")}
    If ($v -eq $true) { Return $true; }
    Return $false;
}

Write-Host "Configuring WF Manager"
$location=Get-ScriptDirectory
ConfigureWFManager "$location\WFFarmSettings.xml"

The following XML file provides the input settings for the above PowerShell script (named as WFFarmSettings.xml in the above PowerShell script). Though you will use a site collection to register the workflow and SharePoint communication, I’ve found that workflow work for all others site collections/web application in the SharePoint Server.

<Settings>
  <SiteUrl>http://siteulr</SiteUrl>
  
  <!--Delete DBPrefix tag, if you don't want any prefix-->
  <DBPrefix>DEV</DBPrefix>
  
  <!--Key used to generate certificates-->
  <CertificationKey>CertificationKey</CertificationKey>
  
  <!--Database server name, database names are hardcoded in powershell-->
  <DBServer>DBServer</DBServer>
  
  <!--Format should be [email protected]>
  <WFManagerRunAsUser>[email protected]</WFManagerRunAsUser>
  <WFManagerRunAsPassword>Password</WFManagerRunAsPassword>

  <!--dot (.) not allowed-->
  <WorkflowNamespace>WorkflowNamespace</WorkflowNamespace>
  
  <!--To work with workflow, app management service need to be provisioned-->
  <AppManagementService Provision="true">
    <Name>App Management Service Application</Name>
    <DBName>AppManagementServiceDB</DBName>
    <!--If managed account already exists with the same name, the existing one will be used-->
    <ManagedAccountUserName></ManagedAccountUserName>
    <ManagedAccountPassword></ManagedAccountPassword>
    <AppPoolName>App Management Service App Pool</AppPoolName>
  </AppManagementService>
</Settings>

SharePoint 2013 Hosting With ASPHostPortal :: How to Use Microsoft SharePoint Workspace Mobile

ahp_freehostSHP(1)With SharePoint Workspace Mobile, you can open, edit, and save Microsoft Office documents that are on a SharePoint 2013 site or on SharePoint Online sites, which are available with Microsoft Office 365. Just go to the Office Hub to get started.

Notes

  • Unless your organization uses a Microsoft Forefront Unified Access Gateway (UAG) server, you can only access a SharePoint 2013 site if you’re in the office and connected to your organization’s Wi-Fi network. For more info, see Connect to a Wi-Fi network.
  • You can access documents that are on a SharePoint Online site at any time and from any location by using your phone’s cellular data connection or any Wi-Fi connection that lets you connect to the Internet.

To open a SharePoint site for the first time on your phone

  1. On Start, flick left to the App list, and then tap Office .
  2. Flick to Locations, and then tap SharePoint.

If you already signed in on your phone with an email account that you have as part of Microsoft Office 365 and your plan includes SharePoint Online, your SharePoint team site will already appear in Locations. Just tap the team site to open it.

  1. Next to https://, type the address for a SharePoint site, document library, list, or folder, and then tap Go .

If you have an Exchange email account set up on your phone, SharePoint will try to use that user name and password information to sign in to the SharePoint site. If you don’t have one set up on your phone, you’ll be prompted to enter your user name and password.

  1. If you’re prompted to sign in, do one of the following:
    • If the Microsoft Office 365 sign-in page appears, type your user ID in the corresponding box, type your password in the Password box, and then tap Sign in.
    • If the Site screen displays, tap the User name box, and type your user name. Type your password in the Password box, tap Domain, and then type the domain for your account. For example, if you log on as “domainName/user” at work, you’d type domainName. Tap Done.
  2. Tap More > Bookmark this link > OK in the Link added screen to bookmark the link for later.

Note

To open another SharePoint site or location later on, flick to Locations in the Office Hub, and then tap New . On the Open URL screen, type the SharePoint site address, and then tap Go .

To browse a SharePoint site

  1. In the Office Hub, flick to Locations.
  2. Tap the SharePoint site, document library, list, or folder that you want to browse.
  3. Tap Up to go up one level in the SharePoint site.
  4. To open the SharePoint site in your phone’s web browser, tap More > Open in browser.

To search the SharePoint site for a document

  1. In the Office Hub, flick to Locations.
  2. Tap the SharePoint site, document library, list, or folder that you want to search.
  3. To search the current view for a document, tap Search . In the Search box, start typing the document name, and then tap the document when you see it.
  4. If no matches are found in the current view, tap Search for documents on to search for the document on the SharePoint site.
  5. Tap the document to open it on your phone.

To open, edit, and save changes to an Office document on a SharePoint site

From your phone, you can open and edit any Office file stored on a SharePoint site.

  1. In the Office Hub, flick to Locations.
  2. Tap the SharePoint site, document library, list, or folder that has the document that you want to open and edit.
  3. Tap the document that you want to open.

A copy is downloaded to your phone.

  1. Make and save your changes as you normally would.

The changes you make will be saved on the SharePoint site. Other people in your company or organization can then open the same version of the document that you modified.

  1. Press the Back button to return to SharePoint Workspace Mobile.

To connect to a SharePoint 2013 site from outside your company’s network

If your organization uses a UAG server, you can connect to a SharePoint 2013 site when you’re away from the office by using either Wi-Fi or your phone’s cellular data connection. To do this, you’ll first need to configure the UAG server settings on your phone.

  1. On Start, flick left to the App list, tap Settings > Applications > Office.
  2. Tap UAG server.
  3. On the UAG server screen, do the following, and then tap Done:
    • In the UAG server address box, type the server address, beginning with https://.
    • In the User name box, type your domain and user name. For example, if you log on to your computer using domainName\user, you would type domainName\user in the box.
    • In the Password box, type your password.

To resolve a conflict

A conflict can occur if you’re editing a document from your phone, make some changes, and then try to save your changes to the SharePoint site after someone else has also made changes to the same document. When this occurs, you need to resolve the conflict before you can save the document back to the SharePoint site.

  1. If the Can’t upload message box is still displayed, tap OK.
  2. In the Office Hub, flick to Locations, tap the SharePoint site, tap and hold the document that has the upload error underneath it, and then tap View status.
  3. Tap Resolve on the Upload status screen.
  4. On the Conflict resolution screen, do one of the following, depending on what you want to do:
    • To update the document on your phone with the latest copy from the SharePoint site, tap Replace item on phone, and then tap Refresh copy. Warning: The changes you made to the document on your phone will be lost.
    • To save a copy of the document that’s on your phone to the SharePoint site, tap Replace item on server, and then tap Refresh copy. Your copy will be saved to the SharePoint site and will overwrite the current version that’s on it.
    • To keep both versions of the document, rename your copy of the document on your phone. Tap Save as, type a file name in the File name box, and then tap Save. Sync your phone with the server so that you also have the newer version of the document from the server, and you’ll have both copies to compare on your phone.

To keep an offline copy of a document on your phone

You can make sure a copy of a document always remains on your phone by keeping it offline. When you do this, a partnership is set up between the copy on the SharePoint site and the one on your phone. If the copy on the SharePoint site is updated and you open the copy of the document that’s on your phone, you’ll be notified and can open the newer version on your phone. Likewise, you can make changes to the document on your phone and save them back to the SharePoint site.

  1. In the Office Hub, flick to Locations.
  2. Tap the SharePoint site, document library, list, or folder that contains the document that you want to keep offline on your phone.
  3. Tap and hold the document, and then tap Always keep offline.

To email a link to a SharePoint site

  1. In the Office Hub, flick to Locations.
  2. Tap and hold the SharePoint site, and then tap Send link.
  3. Tap an email account name.
  4. Add the recipient and any other information to your email, and then tap Send .

Tip

You can also tap and hold on a document library, list, folder, or document, and then tap Send link to send a link to one of these items.