Content Preview: rss
91 days ago
After a solid week of banging my head off my desk, I have finally mashed up a way to programmatically assign the Created By and Modified By fields in a SharePoint Document Library. In my previous post, I mentioned moving a file from one Document Library to a newly created Document Library in a separate Site Collection. That is all well and good. Inserting the document worked perfectly, except for the fact that Created By and Modified By were both ‘System Account’. This was not a proper solution. The correct result would be the originator of the workflow’s LoginName being assigned to those columns. In the end, I realized that simply using RootFolder.Files.Add() meant that the Created By and Modified By fields were Read-Only. After some more forum trolling I was able to mash up a method that took SPUser (the originator) of the workflow and pop their LoginName into both of those fields. I ended up having to use the SPFileCollection object and after obtaining the newly created ...
91 days ago
Over week or two I have been busy creating a custom sequential SharePoint Workflow using Visual Studio 2008. The client requested that a new Document Workspace be created if a user were to select a custom link I added in the EditControlBlock in the dropdown menu for an item in a Document Library. The steps are as follows: Create DocumentWorkspace. Assign Permissions to new workspace. Copy the document that was selected into the newly created site’s Shared Documents library. Checkout the original document in the library in which the workflow was activated. E-mail the owner and members that the site was created. Step 4 was proving to be quite difficult due to the fact that when you call SPFile.Checkout() in the SharePoint object model, it will always check the file out as the system administrator. After trolling the various forums I managed to nail down this one method. Every SharePoint object created and action taken after the impersonatedSiteCollection will be ...
137 days ago
Recently, I had to extend the PeoplePicker’s functionality to include lookup’s in a one-way trusted domain. I found some great posts but decided to consolidate into one post as there were a couple of caveat’s (a.k.a. ‘Command Line Error’s in stsadm). Open a command prompt and change your directory to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN . Run the following STSADM command: stsadm.exe -o setapppassword -password [insert a random password]. The random password can be anything you choose. (It’s used to encrypt/decrypt the password connecting to the other domain/forest) The above command must be run on each web front end of your farm installation. Run the following STSADM command: stsadm.exe –o setproperty –pn peoplepicker-searchadforests –pv <list of forests or domains> -url <webapp> <list of forests or domains> could equal Domain:MyDomain.com or Forest:MyDomain example: stsadm.exe –o setproperty ...
235 days ago
Hello, again. Consider yourself lucky because I’m dropping two posts in a single day! A rarity, for sure. About five months ago I created a Virtual Earth page for a client’s distributor locations around the world. The tricky part was pulling all of this location data from a SharePoint list. As most of you already know (or maybe you don’t), the Virtual Earth routines are all client side JavaScript. Knowing that, you will then realize that accessing SharePoint List items is done through either A.) the SharePoint Object Model in .Net or B.) SharePoint list web services. Initially, I built out a separate .Net web application that pulled all of the location data from the list, wrote out separate JavaScript arrays for the location data to the client, and then pointed the Virtual Earth routines at those arrays in order to build map points. Heavy, I know. And by heavy, I mean lethargic on Page Load. But hey, give me a break, mixing server side and client side code is never a fun ...
235 days ago
Recently, our group deployed a public SharePoint site for a client. After deployment, the client requested the ability to control a page’s title and META tags at any given moment. For example, they wanted to change how product lines were indexed by Google, or how Google crawls the META tags of a particular page. I was immediately frightened by the idea of giving them access to SharePoint Designer and letting them rip away at each page’s source. In the end, I decided to build a custom web part that the user could simply drop on the desired page. Upon Page Load, this invisible web part queries a SharePoint List containing a mapping to other content lists within the site and obtains the user’s desired page title. The code then finds the PlaceHolderPageTitle content place holder, clears the controls from it, and adds in an EncodedLiteral with the new Page Title text. The user also has the ability to create the Keywords and Description META tags for an individual page through this ...



