Friday, February 27, 2015

Arctic SharePoint Challenge Notes

I’m in Oslo at the 5th annual Arctic SharePoint Challenge. This is quite an event. As far as I know, it’s the only hackathon focused purely on SharePoint in the world.


A few stats:




There are also Internet-connected red buttons, a star system map with live Tie Fighter positioning updates, more Web services than you can shake an alien from Alderaan’s finger at, one lynx named Dexter, and so much more I couldn’t possibly list it all. As you can tell from the logo, the theme this year is Star Wars, and everyone is taking it to an extreme in the best possible ways.


2015-02-27_19-20-11


Check out the live blogging that’s going on, the leaderboard so far (new badges soon!), and all of the badges teams can get.


I was honored to be invited to be a judge on the jury as well as to give the opening keynote presentation. I decided to talk about Building JavaScript to Stand the Test of Time. Here’s the presentation on SlideShare.






by Marc D Anderson via Marc D Anderson's Blog

Wednesday, February 25, 2015

Organizations Report Gap Between SharePoint Reality and Expectations

Many SharePoint shops report a gap between reality and expectations, but they are loathe to give up the SharePoint ghost, according to research conducted by management firm AIIM.


read more




by via SharePoint Pro

Monday, February 23, 2015

How to send periodic expiration email notifications in Office 365 and SharePoint 2013 Workflows

Introduction


In this article, I want to cover very common scenario of any business system it is alert notification or reporting subsystem. Usually that functional is responsible to notify end users about new events, overdue tasks and sending summary reports via e-mail. I want to review a couple of simple cases. Which I hope, you can manually customize and implement in your environment. All cases I created are use SharePoint Online with installed Plumsail Workflow Actions Pack, but you can implement it in OnPremise environment as well.




Personal Item/Task/Document expiration reminders


The first case which I want to describe has quite simple simple goal: a user wants to track status of sent Item/Task/Document. It could be application form for business trip, day off request, assigned task or something else. It depends on your business process, but core idea is the same. You have an item with specific due date and a person responsible for this item. You need to send notification message to the user when due date will come and of course you can customize the message template. Using SharePoint Designer you can create a site level workflow which will select all list items by specific query and process each item. As an example, it could generate email by template and send it.




Out of the box workflow actions don’t allow to query list items by CAML or generate email messages by templates. That is why I used some workflow actions from Workflow Actions Pack to extend out of the box functionality.




Below I showed the configured workflow:






I used the following CAML query to get all list items that expire in two days in Get Items by query workflow action:



<View>
<ViewFields>
<FieldRef Name='ID' />
<FieldRef Name='Title' />
<FieldRef Name='DueDate' />
<FieldRef Name='AssignedTo' />
</ViewFields>
<Where>
<And>
<Neq>
<FieldRef Name='Status' />
<Value Type='Choice'>Completed</Value>
</Neq>
<Lt>
<FieldRef Name='DueDate' />
<Value Type='DateTime'><Today OffsetDays='2' /></Value>
</Lt>
</And>
</Where>
</View>




Send email workflow action configuration (to simplify the process I designed the email template inside):



Hello [%Variable: userField%] <br /><br />
Have you had time to look into this? <br /><br />

<a href=”http://ift.tt/1w1zwvX Tasks/DispForm.aspx?ID=[%Variable:ListItemID%]”>[%Variable:ListItemTitle%]</a><br />
The Due Date is [%Variable: DueDate%]

<br /><br />
Kind Regards, <br />
SharePoint Notification System




You can see the sceenshot below as result:








Daily/Weekly/Mounthly aggregated expiration reports by email




The second example which I want to show is based on the same algorithm, but you need to get aggregated summary report instead of sending notifications to each user. To do this you can get all data and use Render Template workflow action to build complete email by predefined template.


Below I implemented the workflow for typical case when an administrator wants to get a summary report with a list of all checked out documents ordered by user.


At the figure below you can see the configured workflow, I split it on two stages to simplify configuration and copying to other document libraries.






The first step is just configuration section.

Next, I got all list items where the field CheckoutUser is not null, I used the following CAML query for this:


<View Scope="RecursiveAll"> <ViewFields>
<FieldRef Name="CheckoutUser"/>
<FieldRef Name="FileRef"/>
<FieldRef Name="FileLeafRef"/>
</ViewFields>
<Query>
<Where>
<IsNotNull>
<FieldRef Name="CheckoutUser"/>
</IsNotNull>
</Where>
<OrderBy>
<FieldRef Name="CheckoutUser"/>
<FieldRef Name="FileLeafRef"/>
</OrderBy>
</Query>
</View>




After it, I prepared data for the Render Text Template workflow action. I used the following template:



Please review the list of documents which was checked out: <br /><br /><table>
<thead>
<td><strong>User Name</strong></td><td><strong>Document</strong></td>
</thead>
<tbody>
{{#each Documents}}
<tr>
<td>{{FieldValues.CheckoutUser}}</td>
<td><a href="{{SiteUrl}}{{FieldValues.FileRef}}">{{FieldValues.FileLeafRef}}</a></td>
</tr>
{{/each}}
</tbody>
</table><br /><br />

Thank you, <br />
SharePoint Notification System. <br />




Before sending the message I used Regular Expression Replace workflow action to replace values in the User’s field from value like 24#;John Martin to 24 – John Martin.


And at the final step I sent complete email report to an administrator








Conclusion


In this article I wanted to describe some common cases which can be used for alerting or reminding purposes. I hope it was clear enough and it will not be difficult to repeat it or customize to your own requirements. Please feel free to comment the article.




Origianl posted at How to send periodic expiration email notifications in Office 365 and SharePoint 2013 Workflows

by Roman Rylov via Everyone's Blog Posts - SharePoint Community

Friday, February 20, 2015

Top 3 Ignite Sessions for Getting the Lowdown on SharePoint 2016

Microsoft Ignite promises to provide a plethora of information, announcements, meetings, opportunities, thought leadership … Wow, that’s a lot to absorb in a week. Fortunately for those focused on what’s coming in SharePoint 2016, Microsoft’s Bill Baer has provided some recommendations for sessions that will provide the most bang for your conference time buck.


read more




by via SharePoint Pro

Wednesday, February 18, 2015

YouTube at 10: How We Got from Bieber to SharePoint to Office 365 Video

While YouTube was once the domain of cat videos, it’s now a platform for everything from breaking news to exclusive presidential interviews (and, yes, still cat videos). In short, YouTube is legit. So is video in the workplace. Here's where it's going.


read more




by via SharePoint Pro

Panopto Aims to Fill SharePoint's Video-Shaped Holes

As companies continue to increase their use of video—for training, marketing and other purposes—the process of managing that video can be daunting. Panopto has released a new app for SharePoint that is designed to fill some of the collaboration platform's video-shaped holes and make it easier and more efficient for users to store and find video content.


read more




by via SharePoint Pro

How to Start SharePoint 2013 Workflows on Selected Items

This blog post appeared as an email response to one of our clients, he described very common use case where you have two libraries of documents, the first library where the users works with draft documents and the other library which is stored the final versions of documents. In this case, users want to be able to select finished documents and move it in one click. Oblivious solution for this is to use a workflow that will move documents to the final document library. But there is one question how we can start the workflow on selected list items? When I was thinking about the answer to that question - I realized that is not as trivial as it seems, because list level workflow can be started only on singl document. How to start multiple workflows on selected documents? In the article, I will describe how you can implement such solution.


I divided this article into three main parts:



  • Get selected items via JavaScript;

  • Start SharePoint 2013 workflow from JavaScript;

  • Add custom button to the list ribbon




Before we start, I want to show what we will get in result. On the figure below you can see the custom button on the ribbon, which will launch a workflows on selected documents.








How to get selected elements via JavaScript


Firstly I will describe how you can get selected List items from SharePoint list. To do this, you can use special JavaScript function getSelectedItems. Please see example below:



var ctx = SP.ClientContext.get_current();var selectedItems = SP.ListOperation.Selection.getSelectedItems(ctx);

for (item in selectedItems)
{
var itemId = selectedItems[item].id;
console.log(itemId);
}




As result of execution, this snippet of code you should see the IDs of selected list items in the console log.




How to start workflow


Since SharePoint 2013 Microsoft has added a new workflow engine. The new JavaScript API for manipulation with workflows also became available. In this article, I will not describe it, but if you are interested, you can find more information from the Andrei Markeev’s blog post. I will show you ready to use JavaScript snippet, which can run workflow on a single list item.



function startWorkflow(itemID, subID) { var context = SP.ClientContext.get_current();
var web = context.get_web();
var wfServiceManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, web);
var subscription = wfServiceManager.getWorkflowSubscriptionService().getSubscription(subID);

context.load(subscription);
context.executeQueryAsync(
function(sender, args){
console.log("Subscription load success. Attempting to start workflow.");
var inputParameters = {};
wfServiceManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription, itemID, inputParameters);

context.executeQueryAsync(
function(sender, args){ console.log("Successfully starting workflow."); },
function(sender, args){
console.log("Failed to start workflow.");
console.log("Error: " + args.get_message() + "\n" + args.get_stackTrace());
}
);
},
function(sender,args){
console.log("Failed to load subscription.");
console.log("Error: " + args.get_message() + "\n" + args.get_stackTrace());
}
);
}




This simple JavaScript function launches a workflow on a list item. The workflow subscription is specified by SubID argument. To identify the subscription ID of your workflow you can navigate to the workflows start page and see the URL in your browser, it should look like this (the bold GUID it is workflow subscription ID): “javascript:StartWorkflow4('6eb43e78-6e6c-486a-9147-3e3870f3a44e', '19', '{FA41C64B-42CD-4A3F-A1AF-CF674AB35C57}')”






How to Add a Button to the SharePoint Ribbon


Very important part is how a user will interact with our system, I believe that the user experience is very important for any system. In our case we plan that the user will select the documents and click on the ribbon button which will move them to another document library.


There are various ways to add a button on the ribbon, but in this article, I want to describe the simplest. We will use SharePoint Designer to do this. When we use SharePoint Designer we have some limitation for example we cannot add new ribbon tab or hide any existing button, but from other point of view if we need just to add button to the ribbon it will take five minutes of our time and it doesn't require programming skills.


Please open the SharePoint Designer, navigate to “List and Libraries” and choose your document library.






To add a ribbon button please click inside the “Custom Actions” area and choose on the ribbon “Custom Actions” – “View Ribbon”.


When you fill in the all fields, you should see something like on the figure below in your list.






Please pay attention at the property “Navigate URL”, I filled it with following text: javascript:PlumsailDemo.WFPack.API.StartListWorkflowOnSelectedItems("{6eb43e78-6e6c-486a-9147-3e3870f3a44e}");




This is a call of our function with argument “Subscription ID” of our workflow.




Join all of it together


OK, we almost did it. All we need to do it is combine and place the JavaScript in SharePoint. To add our JavaScript on the page we will use the ScriptEditor Web part. To do this you need to enter to edit page mode, click on “Add a Web Part” and select “Script Editor” in “Media and Content” group.




I changed the JavaScript file little bit to simplify using



<script type="text/javascript">// <![CDATA[var PlumsailDemo = PlumsailDemo || {};
PlumsailDemo.WFPack = PlumsailDemo.WFPack || {};

PlumsailDemo.WFPack.API = (function() {
var self = this;
self.Context = null,
self.WFManager = null;

SP.SOD.executeFunc("sp.js", "SP.ClientContext" , function(){
SP.SOD.registerSod('sp.workflowservices.js', SP.Utilities.Utility.getLayoutsPageUrl('sp.workflowservices.js'));
SP.SOD.executeFunc('sp.workflowservices.js', "SP.WorkflowServices.WorkflowServicesManager",
function() {
self.Context = SP.ClientContext.get_current();
var web = self.Context.get_web();
self.WFManager = SP.WorkflowServices.WorkflowServicesManager.newObject(self.Context, web);
});
});

StartListWorkflowOnSelectedItems = function(subID) {
var selectedItems = SP.ListOperation.Selection.getSelectedItems(self.Context);

for (item in selectedItems)
{
var itemId = selectedItems[item].id;
self.StartListWorkflow(itemId, subID);
}
};

StartListWorkflow = function(itemID, subID) {
var subscription = self.WFManager.getWorkflowSubscriptionService().getSubscription(subID);

self.Context.load(subscription);
self.Context.executeQueryAsync(
function(sender, args){
var inputParameters = {};

self.WFManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription, itemID, inputParameters);

self.Context.executeQueryAsync(
function(sender, args){
var message = "The workflow " + subscription.get_name() + " was started on item with ID " + itemID;
SP.UI.Notify.addNotification(message, false);
},
function(sender, args){
var message = "Failed to start workflow " + subscription.get_name() + " on item with ID " + itemID;
SP.UI.Notify.addNotification(message, false);
console.log("Failed to start workflow.");
console.log("Error: " + args.get_message() + "\n" + args.get_stackTrace());
}
);
},
function(sender,args){
var message = "Failed to load subscription " + subID;
SP.UI.Notify.addNotification(message, false);
console.log("Failed to load subscription.");
console.log("Error: " + args.get_message() + "\n" + args.get_stackTrace());
}
);

};

return {
StartListWorkflow: StartListWorkflow
, StartListWorkflowOnSelectedItems: StartListWorkflowOnSelectedItems
};
})();
// ]]></script>




Conclusion


In the article, we reviewed the way how you can start multiple workflows on the selected list items. As conclusion, I want to mention about one little detail, in such approach very difficult to monitor the status and errors of the workflows because it works on multiple list items. But you can extend my simple JavaScript with some workflow tracking logic if you have enough JavaScript/SharePoint skills.




You have to understand what will be the load for the system, for small systems this is an acceptable approach, but for highly loaded systems this is not so good. You can consider other approaches for moving documents like single site level workflow or custom coded solution.


As alternative of this approach, you can start a site level workflow and pass to it the selected IDs, but this is the theme of another article.




Please feel free to comment, I will be happy to answer to your questions.




Original article available at our blog

by Roman Rylov via Everyone's Blog Posts - SharePoint Community

Friday, February 13, 2015

SPTechCon Austin 2015 Wrap-Up

A splendid time was had by all at the inaugural Austin, TX version of the venerable SharePoint Technology Conference, usually known as SPTechCon. There was a tangibly different energy in the air at this SPTechCon. I’m sure some of that had to do with the new venue, but there seemed to be a bit more to it than that.


My friends at BZ Media did a wonderful job – as always – with the conference. David Rubinstein, Stacy Burris, Katie Serignese (soon to be Katie Flash!), and the whole team really know what they are doing and it shows.


In addition to the two session I presented, I was honored to be a part of an “expert panel”, discussing ‘SharePoint at the Crossroads’. I think SharePoint always seems to be at some sort of crossroads, so there’s always a lot to talk about.


20150209_202805000_iOS

Photo courtesy Heather Newman (@heddanewman)



After hours, we had a meeting of the SharePoint beards and thought deep thoughts.20150210_223631000_iOS


Here are many of the speakers at the speaker party.


20150210_052836000_iOS

Photo courtesy Christina Wheeler (@cwheeler76)



And what would a trip to Austin be without a stop at Salt Lick? BTW, that dude sitting behind Joel is Chris Tomich. He was there all the way from Perth, Australia (via San Francisco, where he’s spending a few months). Chris is one of my SharePoint heroes (not to slight anyone else), and it was awesome to have the chance to spend a bunch of time with him in Austin.


20150211_140517000_iOS

Photo courtesy Joel Oleson (@joeloleson)



The ‘Q:


20150211_025706464_iOS


Oh, and I presented two sessions. Thanks to everyone who joined me for them. The slides are up on Slideshare if you’d like to take a look.


The session I did on Content Types was a new one for me, and I had an unbelievably large and engaged crowd. Clearly this is a topic area where there need to be more resources available.






by Marc D Anderson via Marc D Anderson's Blog

Thursday, February 12, 2015

Sometimes, it's the simple things

Hey guys. I had a problem and I just had to share the incredibly (or stupid on my part) simple solution.


I was trying to use one of the out of the box workflow templates (3 part, or approval or feedback). When I went to choose one, they didn't show up! I said "What is going on"? Well, it ended up, in the environment we use in 2010, almost every site is a site collection for space reasons. Those templates have to be enabled in the site collection settings, then go to site collection features. When we installed SP 2010, we only enabled 2 of them on site collection creation. Just thought I would share...


Pat




by Patrick Hairston via Everyone's Blog Posts - SharePoint Community

Wednesday, February 11, 2015

SharePoint On-Premises verses Office 365 (Over time)

On SPCOM we run a regular poll that asks visitors to let us know their major version of SharePoint. This post will be kept up to date to show the shift in adoption of the various versions and will also indicate how popular Office 365 is getting..


May 2014



September 2013





by Mark Jones via Everyone's Blog Posts - SharePoint Community

Tuesday, February 10, 2015

First PowerShell Module for SharePoint Online Released

A new PowerShell module has been made available for administrators of SharePoint Online.


read more




by via SharePoint Pro

Incentive Now Provides Tight Integration with SharePoint

With new integration capabilities, users of the Incentive collaboration program can now search, visualize and collaborate on SharePoint files.


read more




by via SharePoint Pro

Monday, February 9, 2015

DFFS v4.253

There were unfortunately quite a few bugs in v4.250. I have tried to address those in v4.253. You find a complete change log here: http://ift.tt/1AglZXU


Please post bugs or questions here: http://ift.tt/1AglYDj


Best regards,

Alexander




by Alexander Bautz via SharePoint JavaScripts

Saturday, February 7, 2015

Free SharePoint iOS App for mobile offline reading!

I have always been quite intrigued by iOS development and how to combine mobile apps with enterprise systems. The first result is a simple but quite useful app that connects to SharePoint Search and allows you to quickly download documents for offline reading.


Get it here: “QuickAccess for SharePoint” – http://ift.tt/1zvqfkD


Built for iPhone and iPad and SharePoint 2010 and 2013. Does currently not work on Office365.





by Oliver Pistor via Everyone's Blog Posts - SharePoint Community

The Elevator Explanation: SharePoint, OneDrive Data Security

As your organization commits more and more critical content to SharePoint--especially online--data security concerns increase.


read more




by via SharePoint Pro

Friday, February 6, 2015

DFFS v4.25x still has a few bugs

Hi,

Unfortunately, DFFS v4.25x still has some bugs. There were made a few fundamental changes to how “initial value” was read, and this new query fails if the list contains more that “the allowed” number of lookup columns – this is columns of type “people picker”, “lookup”, “managed metadata / taxonomy fields”. The number of allowed lookup columns is set on the server side, so I will have to rethink how this query is performed.


I’m currently working on a fix, and will post an updated version during this weekend.


Post any questions or feedback here: http://ift.tt/1AglYDj


Sorry for the inconvenience,

Alexander




by Alexander Bautz via SharePoint JavaScripts

Tuesday, February 3, 2015

Office 365 API Sandbox – Learn how to use the API’s with your own tenant data!

Up until recently I’ve been using a lot of browser extensions and client-side tools for running test-queries and sample-code toward real data or developer-data in our tenants using the REST API in Office 365....


The post Office 365 API Sandbox – Learn how to use the API’s with your own tenant data! appeared first on Tobias Zimmergren's thoughts on technology and business.





by Tobias Zimmergren via Tobias Zimmergren's thoughts on technology and business

Using SharePoint Apps On-Premise and FBA Custom Sign-In Page



Using SharePoint Apps and a Custom Sign In Page

If you follow the Microsoft recommended setup for SharePoint Apps, you will utilize a new domain name to host your apps. See Microsoft recommended setup on technet here - http://ift.tt/15Yw4Mv If you don’t follow the recommendation of hosting your apps with a different domain name, the problem described below should not be present.

The Problem

Following the recommend setup means a user navigates to extranet.contoso.com and after selecting a SharePoint app (such as Corporate News App as I used in my testing) that has been configured, the user will be prompted to login again due to the fact that it is utilizing a separate domain name. If you aren’t using FBA and a custom sign in page then no problem will be present. A problem is presented when utilizing a custom sign in page. Following our ExCM instructions for a custom sign in page, you would access the sign in page in the _layouts directory. From the app domain, this will return a 405 forbidden error. According to extensive consultation with Microsoft this is due to the fact that the apps domain does not have access to the _layouts directory in the 15 folder as other apps would.

Ensure Your Apps Are Working

Before going down the recommended path for correction, let’s be sure your apps are properly configured. It can be a complex process to get SharePoint apps configured properly. We recommend testing without FBA enabled and without a custom sign in page. Doing so takes ExCM out of the picture and ensures your apps are properly configured without introducing additional complexity. If you already have ExCM configured on a web application either create a new web app for testing or in central administration/manage web applications click on your extranet web app, select authentication providers, turn off FBA, and set it to use the default login page.

clip_image001

You should be able to access your app without issue with these settings. If it does not work, then you have an issue unrelated to ExCM, please correct that issue, and start over at this point once a successful test has been completed.

Ensure Problem Exists

Now that you’ve verified SharePoint apps are working on your web app, go ahead and enable FBA and set the custom sign in page in authentication providers for your extranet web app.

This time you should be able to login to your web app with an AD domain account (I utilize “in private” browsing to eliminate any cookie and caching issues that can interfere with testing). Once you click on your app you should receive a 403 forbidden error as below.

clip_image003

Now, in central administration/manage web applications select your Apps redirect web application, then select authentication providers – enable FBA, set the membership provider and role provider names (Ext and Extrole if you use the recommended names in our documentation) and set the custom sign in page to _layouts/spsolutions/excm/signin.aspx (or your custom location and page)

clip_image004

With this set, you should still receive a 403 forbidden error. Verify this is true.

Since the issue is related to the sign in page existing in the _layouts directory, let’s move it to an accessible location for the apps redirect web application. We will move it directly to the IIS directory.

Navigate to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\SPSolutions\ExCM (or alternately your custom sign in page which could be in another location)

Copy the signin.aspx

You need to paste it in a newly created virtual directory within IIS. To do so, open IIS manager, select your Apps redirect web site, right-click and select “Explore.”

clip_image005

Create a new folder called ExCM and paste the signin.aspx to the new folder.

clip_image006

Paste the signin.aspx into the new ExCM folder.

Back in IIS, under your Apps web site, make sure the newly created ExCM folder is present (you might need to refresh).

Right-click on the Apps website and select “Add Virtual Directory.”

clip_image007

Give it an Alias of ExCM and navigate to the appropriate physical path created in previous step.

clip_image008

You now need to go to central administration/manage web applications and select your Apps web app and choose authentication providers. Update the custom sign in page to use this location –~/excm/signin.aspx, rather than the _layouts location.”

clip_image009

Open an in private browser window, navigate to your site and login as normal with an AD account. Next, click on your app, you should now be presented with the custom sign in page. Sign in with your windows credentials and the app should come up successfully.

If you would like to access the app with FBA accounts you need to configure the Apps web.config just as you did your original extranet web app following these steps.

If you have tried and failed, or are considering utilizing SharePoint apps in your on-premise SharePoint installation, I hope this article helps shed some light on how to properly configure your sign in page.
































































by noreply@blogger.com (Aaron Wood) via SharePoint Solutions Blog

Researching Site Template Structure with SPD workflows

Introduction


Usually SharePoint development process looks as follows. You create a new site which is based on one of the standard SharePoint templates (Team Site, Blog, Project Site, etc.) after that, you work hard and customize it very deep (add new lists, views, workflows, customize UI) and finally you will get complete business solution.


But there is another question: "How to deliver your solution to a client?". One of the answers to this question is to use site templates. You can save customized site to WSP package and deploy the package to the customer's environment.


The issue with deployment of template with custom workfllow actions


Looks very interesting and useful, but in SharePoint’s world the Devil is in the detail. For example if you’re using custom workflow actions in your workflows you will get an error during deployment process:



Microsoft.Workflow.Client.ActivityNotFoundException: The activity named 'WorkflowXaml_988fe3c3_dc3e_47a9_8ff3_c912c82eb56d' from scope '/spo/216722f1-1dc0-4c6d-aafd-86b12ef60a14/1f87e1ae-da77-44d4-92d1-502507b5f2d4/34ceaf02-5217-46be-a307-e09dd93da230' was not found. HTTP headers received from the server - ActivityId: 224e672a-4e00-44ed-8b55-894a059608c2. NodeId: . Scope: . Client ActivityId : f6cadd9c-c011-1000-aa42-85eedd28fc19. ---> System.Net.WebException: The remote server returned an error

This not informative message means that the SharePoint tried to publish your workflow, but it can’t find custom workflow action. I saw this issue for several of our clients and after research we have found the reason. It turned up that during deployment process SharePoint doesn’t trigger feature event receivers. Event receiver doesn’t deploy workflow actions and SharePoint throws an error during publishing process (because it can’t find workflow actions used in workflow).


As result of our research, we have found two workarounds how to solve the issue and deploy site template with workflows including custom actions.


The first way: You need to save workflows as templates. Then remove them from the site (you are always able to restore them from saved templates). Deactivate a feature which contains custom actions (In my case it is Workflow Actions Pack) and save site as template. Thus, you have site template and templates of workflows as separate WSP packages. To deploy such site you need to create the new site using your template (without workflows). Then activate feature with your custom actions. Then deploy site workflows templates which you saved earlier.


The second way: You can save the site as template and manually edit WSP package. You need to move workflows to another feature that will be activated manually, also you need to remove workflow actions from modules (because they are deployed via separate WSP package). This is prefered way, but it requires strong developers skills. I will describe it below. And together we will try to automate the solution.


Typical structure of a WSP package


Before can start playing with inner content of WSP package we should understand structure of it.

As you maybe already know any WSP package is renamed CAB archive. If we open it we should see something like this:


Structure of WSP package


The main file “manifest.xml” contains the list of features, each feature is located in separate folder. You may notice that SharePoint divided features by executed functions (CustomActions, ListInstanes, PropertyBags, etc..)

The feature definition files are “Feature.xml” and “Elements.xml”. Additionally a feature may deploy other files, all deployable files are described in the feature definition file.


Typical feature definition looks like:



<Feature Id="{98ae7648-c63b-4473-8921-43355f83e14e}" Title="User custom workflows" Description="Custom user workflows"
Version="1.0.0.0"
Scope="Web"
Hidden="FALSE"
xmlns="http://ift.tt/sQmbje">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
<ElementFile Location="Files\wfsvc\988fe3c3dc3e47a98ff3c912c82eb56d\workflow.xaml" />
<ElementFile Location="Files\wfsvc\988fe3c3dc3e47a98ff3c912c82eb56d\WorkflowAssociation_3d5de7c53c1347fc9779e48926f1d0ef" />
<ElementFile Location="Files\wfsvc\ee7bc602661d442b9ea00f08d09594e8\workflow.xaml" />
<ElementFile Location="Files\wfsvc\ee7bc602661d442b9ea00f08d09594e8\WorkflowAssociation_2351a8b91c354902ab1b6976138d5546" />
</ElementManifests>
</Feature>

As you can see it is pretty simple. The Feature has a Title, ID, Description, link to manifest and a list of included files. If you want to know a little bit more you can read MSDN documentation.


Additionally I want to highlight ONet.xml file, it contains list of features that will be activated during deployment process. Apart from features in package it contains references to dependent features from other packages. An example from this file is shown below:



<!--BaseWeb Feature--><Feature ID="{99fe402e-89a0-45aa-9163-85342e865dc8}" Name="FeatureDefinition/15/99fe402e-89a0-45aa-9163-85342e865dc8" SourceVersion="15.0.0.3" /><!--Plumsail.ActionsPack_Plumsail.ActionsPack Feature-->
<Feature ID="{d7891031-e7f5-4734-8077-9189dd35551c}" Name="FeatureDefinition/15/d7891031-e7f5-4734-8077-9189dd35551c" SourceVersion="0.0.0.0" />
<!--SiteFeedController Feature-->
<Feature ID="{5153156a-63af-4fac-b557-91bd8c315432}" Name="FeatureDefinition/15/5153156a-63af-4fac-b557-91bd8c315432" SourceVersion="15.0.0.0" />
<!--WorkflowTask Feature-->
<Feature ID="{57311b7a-9afd-4ff0-866e-9393ad6647b1}" Name="FeatureDefinition/15/57311b7a-9afd-4ff0-866e-9393ad6647b1" SourceVersion="1.0.0.0" />


The Solution


Now when we studied the structure of typical WSP package we can move forward. I want to write a simple console utility which will repair the WSP package and it will move all workflows to separate feature.

To start we will divide all work on separate stages:



  • Create new directory for workflows feature

  • Create Feature.xml and Elements.xml definitions for the workflow feature

  • Browse all other features and remove custom workflow actions (because the workflow actions are deployed via separate WSP package, if we don't do it in SharePoint Designer we will see duplicated workflow actions)

  • Walk through all other features and move workflows into our new workflow feature.

  • Repackage WSP package.


To ensure that the solution will work we can walk through these steps manually, but the next step we will automate this process and in next part of the article I will show you the main functions of the console program that you can use.


I do not want to clutter the article with lot of code and I will just show examples of the main functions.

To add a new feature we will create Feature.xml and Elements.xml in separate folder inside WSP package.


Firstly we need to create new workflows feature, to do this I used the following code:



void CreateWorkflowFeature(){ wfFeatureDir = Path.Combine(BasePath, WFFeaturePath);
System.IO.Directory.CreateDirectory(wfFeatureDir);
wfFeature = new XDocument(
new XElement(ns + "Feature",
new XAttribute("Id", Guid.NewGuid().ToString()),
new XAttribute("Title", "Template workflows"),
new XAttribute("Description", "Template workflows"),
new XAttribute("Scope", "Web"),
new XAttribute("Version", "1.0.0.0"),
new XElement(ns + "ElementManifests",
new XElement(ns + "ElementManifest", new XAttribute("Location", "Elements.xml")))
));
wfElements = new XDocument(new XElement(ns + "Elements"));
}


Then we need to process the manifest file and iterate through the all features:



var manifestFilePath = Path.Combine(BasePath, "manifest.xml");//Load featuresvar manifest = XDocument.Load(manifestFilePath);
var features = manifest.Descendants(ns + "FeatureManifest");
//Process features list defined in manifest.xml
foreach (var featureDef in features)
{
var featureFile = Path.Combine(BasePath, featureDef.Attribute("Location").Value);
ProcessFeature(featureFile);
}


For each feature I call a list of working methods that will process a feature individually



void ProcessFeature(string featureFile){ var featureDir = Path.GetDirectoryName(featureFile);
var elementsFile = Path.Combine(featureDir, "Elements.xml");

var feature = XDocument.Load(featureFile);
var elements = XDocument.Load(elementsFile);

RemoveCustomActions(feature, elements, featureDir);
RemoveModules(feature, elements, featureDir);
RemoveDependentFeatures(feature, elements, featureDir);
MoveWorkflowModules(feature, elements, featureDir);

//Save files
elements.SaveToFile(elementsFile);
feature.SaveToFile(featureFile);
}


The main thing here in the methods RemoveCustomActions, RemoveModules, RemoveDependentFeatures and MoveWorkflowModules. They work with input XElements and also move files physically. Then we just save the Feature and Elements files.


As result of our work the structure of WSP package will look as follows:


Conclusion


As conclusion of this small research we've got a small console utility that will help you to prepare WSP package to deploy to other SharePoint environment.


All source code is available on GitHub and you can research it more deep or write something useful for your case.


Feel free to comment the article. I will be glad to to answer on interesting questions.


P.S. If you're not a developer and you want to just solve the issue, you can read the following my article where I showed how you can use this small utility.


P.S.S.:Original link to article Researching Site Template Structure with SPD workflows




by Roman Rylov via Everyone's Blog Posts - SharePoint Community

Monday, February 2, 2015

Microsoft Puts SharePoint in Context--in the Cloud and On Premises

In a blog post, Julia White, general manager for the Office Product Management team, laid out some details about the future of SharePoint within the Office ecosystem—in the cloud and on premises. In the process, White may have put some IT and business leaders' minds at ease, saying (in so many words) that there will be a new version of on-premises SharePoint.


read more




by via SharePoint Pro

10 Things You Need to Know about Facebook at Work

For almost as long as Facebook has been in existence, businesspeople have complained about how hard it is to separate their personal and professional lives on the social network. Many people “solved” the problem by just not using Facebook for business. That’s one way to maintain boundaries, but it also, arguably, leaves business opportunity (and professional networking potential) on the table.


read more




by via SharePoint Pro

Sunday, February 1, 2015

DFFS v4.250 released

This release has multiple changes and additions from the previous production release (v4.200). You find the complete changelog her: http://ift.tt/1AglZXU


I will show you one enhancement in particular – the new options for side-by-side headings and labels:

IMG


This layout is achieved with this configuration

In the “Tabs” tab I have added this configuration:

IMG

Please note how the headers are moved to the side-by-side column using the “Header ID”.


In the Side-by-side tab I have added these labels:

IMG


In the Custom CSS section in the Misc tab I have added this code:


.dffs-vertical-text{
text-align:center;
transform: rotate(-90deg);
font-size:22px;
}
td.sbs_tdIndex_1, td.sbs_tdIndex_2, td.sbs_tdIndex_3, td.sbs_tdIndex_4{
width:350px !important;
}
td.sbs_Field input.ms-long, td.sbs_Field div.sp-peoplepicker-topLevel{
width:250px !important;
}

Comments and feedback

Please add any comments, questions or feedback in the forum: http://ift.tt/1AglYDj


Alexander




by Alexander Bautz via SharePoint JavaScripts