Zieglers

Just little about C#, .NET, SQL Server, SharePoint and SAP

SharePoint 2010 Upgrade Videos

Posted by zieglers on April 28, 2011

I’ve recently started a SharePoint 2010 Upgrade project for a client. As a preparation for this upgrade, I performed upgrade scenario on my test environments and captured a series of videos.

Here is a link to SharePoint 2010 Upgrade playlist: http://www.youtube.com/view_play_list?p=7B18675060D89566

http://www.youtube.com/p/7B18675060D89566?hl=en_US&fs=1

zieglers

Posted in IT Stuff, SharePoint | 1 Comment »

How to move files with drag and drop (SPDragDrop) between SharePoint servers

Posted by zieglers on March 21, 2011

Recently I’ve published the codeplex project – Drag and Drop for SharePoint – a SharePoint add-in which gives the drag and drop functionality while working with documents in SharePoint libraries. I got lots of user feedback re its usability and possible improvements for its functionality.

One of the most important improvement idea was ‘to be able to move files between SharePoint servers‘. In other words, users want to move files between document libraries where source and destination libraries reside in two different physically SharePoint servers.

Sounds simple, but implementation of it was not that simple. Eventually i was able to make it. Here is the Youtube video showing how it looks like. In case there will be requests, I may mention of implementation details in another post.

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , , , , , , | 2 Comments »

SAP IDES Installation – Import ABAP Phase taking too long issue

Posted by zieglers on February 19, 2011

So far I lost the count on how many SAP IDES installations I made on different environments. Every installation is a new challenge and comes with own unique problems if there exists any.

Recently I tried SAP IDES ECC 6.0 Installation on Hyper-V environment with a host of 8GB Ram. This time I allocated 6GB Ram to WinServer 2003 R2 Standard Edition client, and took some screenshots to share with you all. I read lots of people out there especially complaining about import ABAP taking too long. Of course there are several factors to that like number of parallel import jobs running or memory allocated for client machine and SQL Server … etc.

Here I’m not going to make any conclusions on that. Simply I want to show you my experience of SAP IDES ECC 6.0 Installation on Hyper-V. Yes, import ABAP phase is going to take a long time, and yes it’ll take a lot longer than you expect. Since this is the case, just be patient and let it run smoothly. During this phase, make sure that your client is not going to run out of disk space. Also, set your power options to ‘always on’ so that your host doesn’t go into sleep mode during installation.

Here is the first minutes of Import ABAP Phase.. Note SQL Server memory consumption. 2.7 GB, not too bad for a 6GB client.

As you can see, below screen clearly shows that my IMPORT ABAP Phase almost took 1 day to complete.

(Yes, I was doing SAP Installation on Valentine’s Day 🙂 Well, technically I was only monitoring it, so no harm done to family life..)

Also, another thing to check is that, make sure all 105 import jobs completed successfully as seen below. You can check this from installer log screen.

Following Import ABAP Phase, sometimes first time start of central instance can take some time, but nothing more than 10-20 minutes. There is a time-out limit for that. Once the central instance is up and running, you’ll see disp+work processes like this.

And finally once the installation is complete, here is what you get.

Now you can go ahead and if you haven’t done already, install your SAP GUI and connect to your SAP System for the first time.You can use your DDIC user and password you provided during installation to log on.

Enjoy.

P.S. Note that your temp license will expire in 1 month.

zieglers

Posted in IT Stuff, SAP | Tagged: , , , , , , , , , , , , , , , , , , , | 3 Comments »

A Real Life Example on why you need localization in SharePoint

Posted by zieglers on February 4, 2011

In this post, i’d like to mention a recent issue i ran into in a client environment in terms of Localization of SharePoint. I’ll give a real life example why they needed localization and what I had to do to support it.

Once you browse the web there are many articles out there talking about what localization is and why you need it. I won’t talk about those here. Rather, i’ll try to explain when a company can face the question ‘When do I have to support localization in my SharePoint applications?‘.

Actually answer is pretty easy! The day you start deploying your SharePoint applications for geographical locations speaking a language other than English, you should start thinking of ‘localizing‘ your applications. Although you deploy your applications in English, sooner or later you’ll get the requests for your application to support different languages. 

Fine. Solution is easy right. Ask infrastructure folks to install necessary language pack on servers and start creating sites in that language, that’s it!

Is it really so??? Not really..

Maybe more important than localizing your SharePoint application, is to code your SharePoint application language-proof. This is the first thing you need to focus on. Once this is properly done, you can start localizing your application for different languages.

But, what do I mean by saying ‘Code your SharePoint application language-proof‘? This is exactly where our Real Life Example kicks in..

Before I go head and show the specifics of the example, here is a good practice.

Search your source code for constant strings in English.

This is a good starting point. Now, let’s be careful here. I’m not saying your code should not have any constant strings at all. Based on your logic you might need them.

However, having some constants in code in English, usually gives you a hint on if that constant might be needed or not if you’d deploy your code in an environment other than English.

Here is an example of that. Following you can see a code snippet where content type names are initially defined in English.

Presumably this means that those constant strings will be used later in that class to refer to OOTB and some custom content types.

Now let’s assume your code needs to remove ootb document content type and add a custom content type to all document libraries.

Somewhere in the code you notice a line like that, which is trying to check if the list you are working on has ootb content type or not.

Obviously, above code won’t work on any SharePoint sites other than English.

Once again I want to emphasize here. We are not applying localization to our SharePoint application yet. We are just trying to make sure that our code can successfully execute on environments deployed other than English.

I found the issue. What do I do now?

If you know that you’ll be using a SharePoint related constant, it’s a best practice to get localized version of that constant from resource files shown as below.

Now, your code can execute without any errors or side effects.

Conclusion

Hope this example helps you to see how easy to determine a localization issue in your code and actually how easy to fix it before errors or any side effects are encountered.

zieglers

Posted in SharePoint | Tagged: , , , , , , , , | Leave a Comment »

Localize your SharePoint using SPLocalize

Posted by zieglers on January 25, 2011

UPDATE: This project is published on CodePlex. http://splocalize.codeplex.com/

Nowadays, I’m working on another CodePlex project called SPLocalize. Basically this solution will help any SharePoint site to be instantly translated to any language. It can be used as an alternative to SharePoint localization. Advantage of this solution is that it doesn’t require any language pack to be installed on your servers.

Here are some teaser screens.. I’ll publish it on CodePlex soon.

Ok.. That many screeens is way enough. I think you got the idea already. 🙂

Any suggestions are welcome..

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , , | Leave a Comment »

Best way to check whether List exists

Posted by zieglers on January 17, 2011

I was trying to figure out the best way to get a list instance from SPWeb object and finally settled down to this one.

There are many different ways to get SPList in SharePoint Object Model, but guess what, there is no Exist() or ListExist() sort of method in object model. What a shame, eh? You can simply loop thru web.Lists collection but there is a price to pay of course..

Needless to say you can’t use it directly like this, web.Lists[“myListName”], since you can easily get an ArgumentException if list you are looking for doesn’t exist.

So, what to do.. Let LINQ handle it for you.. Here is my favourite so far..

web.Lists.Cast<SPList>().Any(mylist => mylist.Title == listName)

OR

Have a static class in your Utility classes like this.

// Check if a list exists in a web
public static bool ListExists(SPWeb web, string listName){
   return web.Lists.Cast<SPList>().Any(list => string.Equals(list.Title, listName));
}

Note that you need .NET 3.5 to use this.

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , | Leave a Comment »

Show loading message during AJAX call

Posted by zieglers on December 15, 2010

Here is quick tip on displaying ‘Loading…’ or ‘Operation in progress…’ type of messages while making an AJAX call in your javascript.

Below snippet will show loadingDiv div element whenever an ajax method call is executing and it will hide the message once method call ends.

<div id=”loadingDiv” style:visibility=”hidden”>Operation in progress…</div>

 $(‘#loadingDiv’)
.hide()  // hide it initially
.ajaxStart(function() {
   $(this).show();
})
.ajaxStop(function() {
   $(this).hide();
});



So, in case you need to do additional stuff once ajax call is finished, plug your code in .ajaxStop. Usual suspects are displaying a message to user, going to another page, refreshing page, …etc.

Also you can create your own loading gif images from this site: http://ajaxload.info/

zieglers

Posted in SharePoint | Leave a Comment »

Multi-Select and Drag-Drop for SharePoint

Posted by zieglers on November 25, 2010

Update-1: (Dec 1st,2010) This project has been published on CodePlex: http://spdragdrop.codeplex.com/

Update-2: (Dec 3rd,2010) ‘Moving Folders’ support implemented, and published.

Update-3: (Dec 13th,2010) ‘Delete Documents’ support coming soon…

Here is a cool jQuery functionality which i have been working on for a while to adapt to SharePoint document libraries. It’s multi-select drag and drop for SharePoint documents. As of now, I managed to hook up this with move operation but in theory any method can be called upon drop action of selected documents.

Here is a teaser screen to show how it looks like..

* Draw a box on documents you want to select. You’ll see that icons of selected documents will be highlighted showing that they are selected. You can also use Ctrl key to select/deselect other documents just like in most operating systems.

* Drag selected documents and drop them onto a folder icon. All selected documents will be moved to that folder.

* As a result of drag&drap, all selected document are moved.

This functionality is using jQuery UI, FronPage RPC (FRPC), and AJAX.

jQuery UI–> multi-select, drag&drop

FRPC –> move document

AJAX –> calling RPC methods.

Soon, i’ll publish this solution on codeplex as well. I’ll be glad if you share any feedback such as other useful scenarios, areas of improvement… etc.

Stay tuned!

zieglers

UPDATE – November 30, 2010

Move Multiple Documents

Move to Folder

In case you want to move multiple documents, you can select them by drawing a rectangle box as seen below.
Selected documents will be highlighted as you draw the box.

When you drag selected documents over a folder, destination folder will be highlighted with dashed lines informing user that it’s an acceptable dropoff location.

Move to Document Library

Alternatively, you can move selected documents to any document library listed in quick launch menu. Once you drag selected documents over a library, similar to folders, library links will be highlighted as well as shown below.
 

 

Move to Parent Folder / Sub Folders

You can also move documents to any sub folder in a document library. In order to do so, simply drag selected documents to any sub folder breadcrumb link as seen below.

Technology Used
jQuery, jQuery UI, FrontPage RPC

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , , , , | 2 Comments »

Selectable rows in SharePoint using jQuery UI

Posted by zieglers on November 22, 2010

Here is a quick tip. If you’d like to make rows in document libraries selectable, jQuery UI Selectable is the perfect fit for this.

*Select multiple rows

* Urls of selected documents will be shown.

All you have to do is refer to jQuery UI js, and select your DOM elements to make them selectable and apply your logic.

In this demo, i’ll simply display urls for selected documents. Go ahead and add a CEWP in your document library page. Then select listviewtable as follows. Your function should look like this:

<script>
$(function() {

//make listviewtable selectable
    $(“.ms-listviewtable“).selectable({

      filter: “tr“,  

      stop: function() {
         // display urls of selected documents
         var result = $( “#select-result” ).empty();
         $( “.ui-selected”, this ).each(function() {

             var index = $( ‘a’, this ).attr( ‘href’ );
             result.append( “<br/>” + ( index ) );

         }); // end – each

      } //end – stop

    }); // end – selectable

}

</script>

<span id=”select-result”></span>

So, above code is making all rows in listview table selectable and once you select one or multiple rows, urls are displayed. That part is done in stop function of selectable above.

Now, you selected multiple rows and you have IDs, URLs, …etc. for them, you can simply use that information as an input to your own logic.

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , | Leave a Comment »

Dynamic jQuery Tooltips for SharePoint

Posted by zieglers on November 10, 2010

In this post, I’ll try to show how you can implement tooltips with dynamic content for any link in SharePoint pages.

 

Ingredients

  • jquery.1.4.3.min.js
  • jquery.simpletip-1.3.1.min.js
  • jquery.SPServices-0.5.7.min.js
  • 1 teaspoon custom tooltip style
  • 1 CEWP

 

Preparation

 

Add jQuery references

 

Firstly, add a CEWP to your site home page. Then edit your CEWP in Source Editor and add the following references with low heat.

<script type=”text/javascript” language=”javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js”></script&gt;

<script language=”javascript” type=”text/javascript” src=”Shared%20Documents/jquery.SPServices-0.5.7.min.js”></script>

<script type=”text/javascript” language=”javascript” src=”Shared%20Documents/jquery.simpletip-1.3.1.min.js”></script>

Add jQuery libraries

While references are getting warmer, add below files in your Shared Documents pot.

 jquery.1.4.3.min.js

http://code.google.com/apis/libraries/devguide.html#jquery

jquery.simpletip-1.3.1.min.js

http://craigsworks.com/projects/simpletip/

jquery.SPServices-0.5.7.min.js

http://spservices.codeplex.com/

Get code structure ready

Secondly, add your javascript code skeleton to your CEWP.

<script type=”text/javascript”> 

$(document).ready(function() {

   // Code goes here

   }); // end – document ready

</script>

Ok, so far our preparation is done. Now we can start cooking our meal.


Call SharePoint Web Services using jQuery

Since I chose ‘list permissions’ as for our dynamic content flavor for our tooltip, first we need to call GetPermissionCollection method of permissions.asmx web service. For a given list, this call will return us all the taste we are used to getting from a list permissions page such as the one below.

 

Call permissions web service

Add following code to your document.ready pot.

// Call permissions web service

  $().SPServices({

    url: “/_vti_bin/permissions.asmx”,

    operation: “GetPermissionCollection”,

    async: false,

    objectName: “Tasks”,

    objectType: “List”,

    completefunc: function (xData, Status) {

           // Format your output here

       } // end – completefunc

  }); // end – SPServices

Once web service is successfully invoked, the result will be returned in xData. Then, in completefunc method, you can modify, format, display your result as you wish.

In this case, I choose to feed my tooltip with the result of my web service call. This will allow me to show list permissions, once user hovers mouse over a list in quick launch menu.

Select fields you want to display

But before I do so, I need to select which part of result I need to show in my tooltip. Here, I choose to show only users and groups which have permissions on that list.

Add following code to your completefunc pot.

            // Loop thru each permission

            // Display users and groups

            //$(xData.responseXML).find(“Permission”).each(function() {

            $(xData.responseXML).find(“Permission”).each(function() {

                 var xmlGroupName = $(this).attr(“GroupName”);

                 var strGroupName = String(xmlGroupName);

                 var xmlUserLogin = $(this).attr(“UserLogin”);

                 var strUserLogin = String(xmlUserLogin );

                 if (strGroupName != ‘undefined’)

                     $(“#callResponse”).append(“<li>” + strGroupName + “</li>”);

                 else

                     $(“#callResponse”).append(“<li>” + strUserLogin  + “</li>”);

            });

In above code you’ll see that group and user names are appended to a div element, whose id is callResponse. So, let’s add that div too in our CEWP. You can put anywhere outside of <script> tags.

Add Tooltip to SharePoint links

 

We are done with heavy lifting, now it is show-off time. Our meal has been cooked to perfection and ready to be served now. One last thing to do: get tooltip plate ready.

I chose Tasks link in quick launch menu as my victim. I’ll add my tooltip to Tasks link so that when users mouse over that link, they’ll see my delicious list permissions content in a beautifully served tooltip plate.

Add following code after the end of SPServices line.

    // Tooltip

    $(‘a[href*=”Tasks”]’).simpletip({

       content: $(“#callResponse”),

       offset: [50, 0]

    }); // end – Tooltip


Add Tooltip Style

Finally, before we get our plate in hand and walk out of kitchen door, a final touch-up is required to wow our guests. That one is our humble inline style below. Of course if you wish, you can put that style in your some css files later on.

<STYLE>

.tooltip{

  position: absolute;

  width: 250px;

  padding: 8px 10px;

  background-color: #F2F2F2;

  border: 2px solid #848484;

  cursor: pointer;

  text-decoration:none;

}

</STYLE>

Conclusion

Now you walk out of SharePoint development kitchen door and put your masterpiece in front of your guests and enjoy watching them when they are eating.

Bon Appetit!!!

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , | 1 Comment »