programming against Userprofileproperty Choicelist

Ok, so i was aked to program against the userprofileproperty choicelist.

The choicelist is the property of a userprofileproperty, when the userprofileproperty is a choicelist (sounds logic, not ?)

First i created a user profile property of the type choicelist.
I created a piece of code to connect to the userprofiles and retrieve the specific property. After retrieving the property, i retrieved the values of the choicelist.

Unfortunately, these values are “simple” strings without any form of ID. At least, not through the api.

I had the property object, next thing > add the value(s) AND don’t forget : programmed the commit.

I ran the code, and no errors, however, also no added values.

After some debugging and digging, i found out that adding value to the choicelist is not considered a change for profileproperties.

Funny ? NOT!

Then let’s create a workaround. Before committing , i programmed some code that forces the state of the property to : changed.
That way the values where added together with the change that in fact, wasn’t a real change.
Please notice the portion regarding the description :-)

                ServerContext sc = ServerContext.GetContext(curSite);
                UserProfileManager upm = new UserProfileManager(sc);

                Property p = upm.Properties.GetPropertyByName(Propertyname);
                p.ChoiceList.Add(Value);
                string descript = p.Description;
                p.Description = "";
                p.Description = descript;
                p.Commit()

after using this addition, the values where added succesfully to the property.

Hope this might help others.

Eric

SharePoint 2010 Public Beta is now available for download

Yes !

it’s finally there.

SharePoint Public Beta Resources

Where can I download SharePoint 2010 public beta?
You can download SharePoint and Office 2010 public beta from http://www.microsoft.com/2010

Is the SharePoint public beta supported?
The SharePoint public beta is not supported. However, we recommend looking at our resources listed above and asking questions in the SharePoint 2010 forums.

When is the final release of SharePoint and Office 2010?
We are planning to release SharePoint and Office 2010 in the first half of calendar year 2010.

Will there be a migration path from SharePoint public beta to final release?
We do not plan to support a SharePoint 2010 public beta to release bits migration path. The SharePoint 2010 public beta should be used for evaluation and feedback purposes only.

If I’m on SharePoint 2007, how do I get ready for SharePoint 2010?
Take a look here for getting ready guidance.

Is there a downloadable SharePoint 2010 VHD?
We plan to make a VHD available for download sometime in the future. We will announce its availability on our team blog.

How do I get trained on SharePoint 2010?
Please review the Getting Started page, the  IT Professional learning guide , the Developer learning guide , and the End User resources to ramp up on SharePoint 2010.

Sharepoint 2010 learning snack now available

Microsoft  has some nice snacks:  Microsoft Learning Snacks

the come in several flavours, but one of them is : Microsoft SharePoint Server 2010

there are 3 Sharepoint 2010 snacks

  1. Developing Solutions with Microsoft SharePoint Server 2010 (20 minutes)
    Microsoft SharePoint Server 2010 enables developers to build rich solutions easily, rapidly, and efficiently. This Learning Snack demonstrates how you can use Microsoft Visual Studio 2010 to create and deploy your solutions. It also demonstrates how you can build Microsoft Silverlight applications by using the SharePoint 2010 client object model, and how you can use LINQ to SharePoint to create SharePoint entities.
  2. Experiencing the Microsoft SharePoint Server 2010 User Interface (20 minutes)
    Microsoft SharePoint Server 2010 includes an enhanced user interface that provides IT professionals with a streamlined administration experience. This Learning Snack describes the features of the SharePoint Server 2010 user interface. It demonstrates how the new Central Administration console enables you to perform several administrative tasks from one central location. The Learning Snack also describes how shared application architecture can be used for flexible deployments in SharePoint Server 2010.
  3. Managing and Troubleshooting with Microsoft SharePoint Server 2010 (17 minutes)
    Microsoft SharePoint Server 2010 facilitates administration by providing several tools that help IT professionals efficiently manage data and troubleshoot any issues. This Learning Snack describes the Large List Resource Throttling feature, which helps you manage large lists. It demonstrates how a Microsoft SQL Server logging database can be used to log SharePoint events. The Learning Snack also demonstrates how the SharePoint Best Practices Analyzer can be used to detect and automatically fix common issues.

other snack-tastes are :

    bon appetit.

    Eric

    New Sharepoint 2010 Certification

    SharePoint 2010 Role-Based Learning Resources and Future Certifications (source Microsoft Partner site)
     
    Future SharePoint 2010 Certification Opportunities for IT Professionals: Coming in June 2010
    Certification Path for IT professionals
    • 70-667 TS: Microsoft SharePoint 2010, Configuring
      Microsoft Official Curriculum: Will cover configuration of SharePoint 2010 including deployment, upgrade, management, and operation on a server farm.
    • 70-668 PRO: SharePoint 2010, Administrator
      Microsoft Official Curriculum: Will cover advanced SharePoint 2010 topics including capacity planning, topology designing, and performance tuning.
     
    Certification Path for Developers
    • 70-573 TS: Microsoft SharePoint 2010, Application Development
      Microsoft Official Curriculum: Five-day instructor-led course designed for developers with six months or more of .NET development experience. Course covers what you need to know to be an effective member of a SharePoint development team using Visual Studio 2010.
    • 70-576 PRO: Designing and Developing Microsoft SharePoint 2010 Applications
      Microsoft Official Curriculum: Five-day instructor-led training course designed for development team leads who have already passed the Developing on SharePoint 2010 technical specialist exam. The course covers choosing technologies for and scoping a SharePoint project, best practices for SharePoint development, configuring a SharePoint development environment, advanced use of SharePoint developer features, and debugging of code in a SharePoint project.

    Eric

    SharePoint Foundation 2010 : What’s in a Name (and New!)

    For all you out there wondering what SharePoint Foundation 2010 means,

    it’s the new name for Windows Sharepoint Services

    But now we are talking about Sharepoint Foundation 2010, what is new ?
    [This documentation is preliminary and is subject to change. source: Microsoft]

    • Alerts Enhancements : Microsoft SharePoint Foundation 2010 expands the alerts framework to enable users to have alerts sent as Short Message Service (SMS) messages to their mobile devices.
    •  Business Connectivity Services : Business Connectivity Services (formerly named the Business Data Catalog) provides read/write access to external data from line-of-business (LOB) systems, Web services, databases, and other external systems within Microsoft SharePoint 2010. SharePoint 2010 has product features that can use external data directly, both online and offline. Developers can gain access to a rich set of features and rapidly build solutions using familiar tools such as Microsoft Visual Studio 2010 and Microsoft SharePoint Designer 2010. Microsoft Business Connectivity Services (BCS) enhances SharePoint application capabilities and their UI through features, services, and tools. These enhanced capabilities and UI streamline development of solutions with deep integration of external data and services. Power users, developers, and business unit IT professionals can integrate assets from external systems and enable interaction with the external data through many types of applications. The Business Connectivity Services feature set enables rapid development and deployment of scalable and security-rich solutions.
    • Client Object Model : Microsoft SharePoint Foundation 2010 introduces three new client APIs for interacting with SharePoint sites: from a .NET managed application (Microsoft® .NET Framework 3.5 or later), from a Silverlight application (Microsoft® Silverlight™ 2.0), or from ECMAScript (JavaScript, JScript) that executes in the browser. These new APIs provide access to a subset of the types and members that are contained in the Microsoft.SharePoint namespace of the server-side object model.
    • Events Improvements : Microsoft SharePoint Foundation 2010 supports multiple new events, including on-create events for lists and Web sites and support for synchronous after events. Many of the new events are available in both synchronous and asynchronous modes. SharePoint Foundation offers a more approachable events infrastructure that is easier to program against than earlier versions.
    • Microsoft Synch Framework : The Microsoft Synch Framework in SharePoint Foundation is a comprehensive and unified synchronization architecture that provides data-agnostic and bidirectional capabilities to developers. Because it was designed to provide cross-application synchronization, implementing the Microsoft Synch Framework allows other Microsoft and third-party applications to synch more easily with SharePoint Foundation 2010 deployments.
    • Mobile Device Development Enhancements : Microsoft SharePoint Foundation 2010 greatly expands access from mobile devices to SharePoint Foundation pages, lists, and functionality.
    • Query Enhancements : Microsoft SharePoint Foundation 2010 includes several new ways to query and filter data.
    • Ribbon : The Ribbon offers new functionality in the Microsoft SharePoint Foundation 2010 user interface. The Ribbon serves as the primary command surface that you can use to interact with objects inside of SharePoint Foundation. In earlier product versions, commands were accessed across multiple surfaces and located in varying menus. With the introduction of the Ribbon, commands are grouped in a logical manner through the use of tabs and groups, making them easy to find. You can also extend the functionality of the Ribbon to include your own custom functions.
    • Sandboxed Solutions : A sandboxed solution is a new concept in Microsoft SharePoint Foundation that allows site collection users to upload their own custom code solutions. A sandboxed solution uses a subset of the Microsoft.SharePoint namespace. These objects are marked in the object model to show their availability in a sandboxed solution. All sandboxed solutions are stored in a solution gallery. In addition, there are facilities provided to help server farm administrators monitor and validate solutions that have been uploaded to these galleries. Performance can be monitored by measuring CPU execution time, memory consumption, and database query time. You can also monitor other aspects of operation including abnormal termination, critical exceptions, unhandled exceptions, and data marshaling size.
    • Service Application Framework : The Service Application Framework provides a platform that allows developers to build scalable middle-tier applications that are hosted in Microsoft SharePoint Foundation 2010 and that provide data or processing resources to other SharePoint features. The Service Application Framework enables services to be shared between computers on a server farm; it also helps load balance and manage services in SharePoint. The Service Application Framework provides over 20 services that are built into the core product. For example, SharePoint Search is implemented by Service Application Framework. The Service Application Framework is an API provided by back-end application servers and consumed by front-end Web servers.The Service Application Framework replaces the Shared Services Provider in Microsoft Office SharePoint Server 2007.
    • Silverlight Integration and the Fluid Application Model : In Windows SharePoint Services 3.0, you could host a Microsoft Silverlight application in a Web Part. Microsoft SharePoint Foundation 2010 goes beyond by providing a built-in, extensible, Silverlight Web Part specifically designed to host Silverlight applications. Closely related to the new Web Part is the Fluid Application Model (FAM) that enables secure, cross-domain, integration between external applications and SharePoint Foundation deployments.
    • UI Improvements : The user interface (UI) in Microsoft SharePoint Foundation has been upgraded significantly. This includes the introduction of the Ribbon, a revamped master page, and new cascading style sheets (CSS). Each of these enhancements creates a more consistent experience for users across pages and makes it easier to work with objects inside SharePoint Foundation.
    • Windows PowerShell for SharePoint : Windows PowerShell™ command-line interface is a new command-line tool and supporting scripting language from Microsoft that complements Cmd.exe in the Windows administration context. In the SharePoint administration context, Windows PowerShell supersedes the Stsadm.exe administration tool. Moving forward, you should use Windows PowerShell scripting technology to develop any new command-line scripts in SharePoint Foundation 2010.
    • Workflow Improvements : In Windows SharePoint Services 3.0, the Windows Workflow Foundation provided a highly extensible workflow model to the SharePoint platform. Microsoft SharePoint Foundation 2010 continues to build upon the functionality available in Windows SharePoint Services 3.0 and improves and expands your options so that you can build rich workflows that can accommodate even more complex business scenarios. This topic presents the new features that are available for workflows in SharePoint Foundation 2010.

     

    Just so you all know :-)

     

    eric

    Single Sign ON : weird error related to AAM

    In one of the teams i’m working, we had an issue with double-hop.

    When using NTLM and several servers need to be connected, this could be an issue.
    Example: when you use 2 web front ends in combination with forms, everything is allright.
    But, when the form uses webservices for collecting information, you could run into the double-hop problem.

    Standard: NTLM will only authenticated between 2 computers, any extra computer will nog be authenticated to.

    Within Sharepoint you can overcome this issue by implementing Kerberos or Single Sign ON.

    Due to the nature of kerberos (delegation of control), we decided to go for Single Sign ON.

    At this moment, single sign on works every now and then, but never without faults and never longer then 4 hours.
    The configuration was cleared every 24 hours (!?)
    During examining the logs and application log, a weird error caught our attention.
    Some more investigating learned that these errors where created during single sign on configuration.

    The error was related to localhost in combination with Alternate Access Mapping.

    How is this possible ?

    The name of out server was (fake name) : mossapp
    we created AAM config lines pointing to mossapp. Everything is working as intended (including central administration)

    All sites go to the right host(header).
    But single sign on complains about not finding Localhost.

    So we added localhost to the AAM pointing to mossapp.

    And guess what : the errors where gone !

    At this moment the configuration is no longer cleared, but unfortunately, single sign on is still not working as intended.
    although, if it’s working, it works for at least 8 hours.

    Anyone ideas about this issue ?

    eric

    Openbinary() odd behaviour.

    Yesterday i was programming a new functionality.

    I wanted to open a (word) document in code and in code write it to a different location.
    During this process some data and information would be added to the file.

    While debugging, everything was working like a charm.

    But at runtime (without debugging) i got this odd error :The path specified is being used in a substitute.

    How is this possible. It worked while debugging, but without debugging not. ODD

    SO, i did what any developer would do: google the error. And this brought me to this site : Chandru’s Sharepoint / MCMS Blog.

    He had the same problem. Seems that the way you call openbinary is causing the problem.

    If you use the guid to open the file, you need to add a line (something like string s = file.Name) which in turn makes sure the openbinary works. Somehow when using the guid, the URL of the file is not created. If you question a property (like Name), the URL will be created.

    When using the URL of the filename for opening the file, you won’t get this error.

    This information solved my problem :-)

    Goto chandru’s site for more information about this error.

    Eric

    How to control the new! icon

    I get a lot of questions about the new icon  in Sharepoint.

     

    • How long does it stay (default)
    • how can i change that, there is no option in central administration or in the list settings

    Well, that’s because it can only be changed by stsadm.

    It is displayed by default for 2 (two!) days. Most common is that users think it is only displayed for 1 day, or that it remains there until you get there and then it will stay there for 1 day.

    So how to change:

    assuming you have updated your path so you can stsadm everywhere (else goto the bin directory in the 12-hive)
    type the following command :

    stsadm.exe -o setproperty -propertyname days-to-show-new-icon -propertyvalue [days the icon will be visible] -url [Your Virtual Server"s URL]

    If you don’t want the icon to be visible, set the propertyvalue to 0 (zero)!

    Have fun

    Eric