Monday, January 30, 2012

Sharepoint 2010 - Delete this List link missing

If menu item "Delete this List" in list settings is missing or, in Sharepoint Designer 2010, you receive error in deleting list/library, may be problems is for AllowDeletion property of the List/Library.

Once you declare an item as a record in a list, the corresponding lists SPList.AllowDeletion property is set to False. This is why you no longer see the "Delete this List" link in the list settings and is intended to protect lists with items declared as records.

You can use PowerShell to delete the list (using the SharePoint 2010 Management Shell):

$assignment = Start-SPAssignment
$web = Get-SPWeb -Identity "http://yoursite" -AssignmentCollection $assignment
$list = $web.lists["Your List Title"]
$list.AllowDeletion = $true
$list.Update() #after this is entered, the "Delete this List" link will reappear in the UI for the List Settings
$list.Delete() #this will delete the list
Stop-SPAssignment $assignment

Yes, it's works.

Google Android - Low resolution in People pics?


My wife has a mobile phone with Android. I have configured the account on Gmail (and consequently, now on all Google services), putting a photo for her profile (in GMail, please note!).
But the little pic that I put, despite having uploaded a high-resolution photo, on my Nexus S is just very low quality.

I came across this "problem" that I discovered not only mine. No concrete solution around, then I started found mine.

Photos of contacts on Android, appear in 96 x 96 pixels.
Which is sufficient for most smartphones with Google's operating system.

But with Ice Cream Sandwich (Android 4), the application People (former contacts), the problem is a bit more visible. or rather, you see, but just bad ...

Selecting a contact, the picture (if coming from Gmail) appears with a higher resolution, then it is low.

There are different solutions for photos coming for example from Facebook via third party applications, but goes for Facebook.

But today I discovered an interesting thing, however if you get good friends to perform this simple procedure ...

GMail is the "cause" of everything, because it saves the photos uploaded as mail profile in 96 x 96 ...
Here are the steps to follow.

In your GMail settings, remove the photo of your profile.

Go now on Google+ and upload a complete profile with a beautiful high resolution photos.


On the smartphone, sync contacts: you will see two contacts, one without photos (Gmail contact is, probably with the mobile phone number) and one with the picture (is the Google profile +).
Merge the two contacts.

Result: the contact takes the photos in high resolution!

But how to do it for your own pictures of Gmail? Because I removed, then on other services (Latitude, ...) you don't see it.
Go into Gmail and reset the photo to profile: keeping contacts merged, now your smartphone takes photos to high resolution!

Great treak!

The problem is to say to your Gmail friends to do this way....

Friday, January 27, 2012

Google - Foto sgranate nei Contatti di Android?

Mia moglie ha da poco un telefonino con Android. Le ho configurato l'account su Gmail (e di conseguenza, adesso, su tutti i servizi di Google), mettendo una foto per il suo profilo (in GMail, nota bene!).
Ma la fotina che le ho messo, pur avendo caricato una foto ad alta risoluzione, sul mio Nexus S viene proprio ben sgranata.

Mi sono imbattuto in questo "problema" che ho scoperto non essere solo mio. Nessuna soluzione concreta in giro, allora mi sono ingegnato.

Le foto dei contatti, su Android, vengono visualizzate in 96x96 pixel.
Il che è sufficiente per la maggior parte degli Smartphone con il sistema operativo di Google.

Ma con l'arrivo di Ice Cream Sandwich (Android 4), nell'applicazione People (ex Contatti), il problema è un po' più visibile.. o anzi, si vede, però proprio male..

Selezionando un contatto, la sua foto (se proveniente da Gmail) viene visualizzata con una risoluzione maggiore, quindi viene sgranata.

Ci sono diverse soluzioni, per le foto proveniente ad esempio da Facebook tramite applicazioni di terze parti, ma vale per Facebook.

Ma oggi ho scoperto una cosa interessante, valida però se convincete i vostri amici a eseguire questa semplice procedura...

GMail è la "causa" del tutto, poiché salva le foto caricate come profilo di posta in 96x96...
Ecco i passi da seguire.

Nelle impostazioni di GMail, togliere la foto del proprio profilo.

Andare, ora, su Google+ e caricare un profilo completo con una bella foto ad alta risoluzione.


Sullo smartphone, sincronizzare i contatti: si vedranno due contatti, uno senza foto (è il contatto Gmail, probabilmente con il numero di cellulare) e uno con la foto (è il profilo di Google+).
Unire i due contatti.

Risultato: il contatto prende la foto senza essere sgranata!

Ma come fare per la propria foto di Gmail? Già perché l'ho tolta, quindi su altri servizi (Latitude, ...) non la vedo.
Tornate in Gmail e reimpostate la foto per il profilo: mantenendo uniti i contatti, ormai il vostro smartphone si tiene la foto ad alta risoluzione!

Grande Barbatrucco!

Il problema è convincere i vostri amici di Gmail, con foto sgranata, a fare questo giro....

Beh, questa soluzione, se vi basta che quella della moglie venga bene, se ci tenete (eheheh), è ottima :-)

Thursday, January 19, 2012

Sharepoint 2010 - Ajax List Web Part

I need web part that read from Site Collection, each Subsite, each Document Library, each Document, and return list of latest Documents of the entire Site Collection.
Not very hard to develop, but it's very very bad in performance.. Web Part page take a long time to render.
So the ajax idea. But how to?
I found no way to expose ajax properties in tool panel of WP developed in VStudio.
If you know how to.... write me, please!

I checked out many posts, forums, articles about how to integrate Ajax Toolkit in Sharepoint.
Then I do my way.

I referenced Ajax Toolkit dll in my project.
Download the right toolkit for Sharepoint here: http://ajaxcontroltoolkit.codeplex.com/releases/view/33804.

To use the Ajax Control Toolkit in any web part control add the following lines to register the Ajax Control Toolkit namespace:

<%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736,
 Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

I see article that says to add this in master.page and substitute original scriptmanager with a new one that use prefix ajaxToolkit (http://ranaictiu-technicalblog.blogspot.com/2010/08/ajax-control-toolkit-with-sharepoint.html). I'm not sure that it needed, I did both but works anywhere.

Now you can use <asp:UpdatePanel> in your Visual Web Part.

Here my code with a simple explanation:



<asp:UpdatePanel ID="UpdatePanelDocuments" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Timer runat="server" id="TimerDocuments" Interval="2000" OnTick="TimerDocuments_Tick"></asp:Timer>
    <div style="width:100%;">
<SharePoint:SPGridView ID="oGrid" runat="server" AutoGenerateColumns="false" CssClass="ms-listviewtable">
    <RowStyle CssClass="ms-itmhover" />
    <AlternatingRowStyle CssClass="ms-alternating ms-itmhover" />
    <HeaderStyle CssClass="ms-viewheadertr ms-vhltr" />
    <PagerStyle CssClass="document_pager" />
        <Columns>
        ...
        </Columns>
    </SharePoint:SPGridView>
    </div>
    <div id="DivImgLoadingDocuments" runat="server" style="padding:10px;"><img src="/_Layouts/Images/kpiprogressbar.gif" alt="Caricamento Documenti..." runat="server" id="ImgLoadingDocuments" /></div>
    </ContentTemplate>
 </asp:UpdatePanel>

The <asp:Timer> control is for start loading (and the updatepanel update) after 2 seconds: in the code behind, the event onTick set the timer to disable, because we don't need to reload again!

The <div> with the progress image will be hidden after load is completed.

The <SPGridView> is rendered in ajax mode.



I'm pretty sure that exists a better method to do this Ajax List but I've found this and it's all I want.







Monday, January 9, 2012

Sharepoint 2010 - Set Editor (Modified By) for Document in Doc Lib

I found many problems to update the field "Modified By" in a document loaded programmatically in a Document Library.

After several attempts I found my solution.

Use the "vti_modifiedby" from ListItem.File.Properties.

Therefore, you must run these lines of code:

spListItem.File.Properties["vti_modifiedby"] = SPContext.CurrentWeb.CurrentUser.LoginName;
//Properties wants string
spListItem.File.Update();

It Works!
It does not works for  Document Set. I have not found the correct procedure.

If anyone knows, write me!