in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Alex Pearce's SharePoint Blog

Alex Pearce

May 2008 - Posts

  • Improved Image Web Part

    I've never really liked the image web part that came out of the box with SharePoint!  Looking at it from a users point of view it was too many tasks to upload a single image.

    1. Add a picture library to your site
    2. Upload your image to the image library via Microsoft Office Picture Manager
    3. Find the URL of the image
    4. Add the image web part to your site
    5. add the URL of the image to your web part

    This new image web part does all this for you.

    1. Add the image web part to you site
    2. Use browse to add the images
    3. Click save

     

    So much more user friendly.

    It adds the URL of the image for you, saving the user having to find, copy and add this information.

    You can download this web part from codeplex

    http://www.codeplex.com/ImageUpload/Release/ProjectReleases.aspx?ReleaseId=13397

    A document file is attached to the download - I didn't user it - so here is how to install it

    Install the WSP file and add the solution to your site.

    When you add the web part to your site it tells you that you need to set the default location to upload images.

    Create a image library at the top of you site.  All users who need to be able to add images to anywhere on your site application need to have write permission to this library.  You can hide the library where ever you want - even in another web application.

    the script for this is

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>STSADM -o SetImageUploadLocation -webapp http://127.0.0.1/ -library http://127.0.0.1/PublishingImages

     

    Posted May 28 2008, 11:46 AM by apearce with 5 comment(s)
    Filed under: ,
  • Free Microsoft Software for Students

    Microsoft are giving away software to students for free.  This is great!  I'm so please that they have decided to set up a scheme that allows this.

    Microsoft Dream Spark gives students access to Microsoft Windows Server, Visual Studio, Expressions Studio and XNA to help them become either IT Pros or Developers.

    Your local authority or university have to join the scheme but after that you can apply to get it.

    I think this is a great step to giving students free software.  Next step - feel licensing to all schools!

    https://downloads.channel8.msdn.com/

    Sorry its a little off subject but education is my passion!

    Posted May 19 2008, 02:23 PM by apearce with no comments
    Filed under:
  • SharePoint at Twynham School

    A few months ago I posted a PDF of what a school in Christchurch, UK had done with SharePoint which included making their own webparts.

    I met up with the guys from Twynham and it was a great meeting which also include the representatives from Shirelands.

    I had a email from Dave at Twynham the other day to say he has made some videos of the use of SharePoint in the school and has published them on the internet.

    These are great thing to look at if your looking at implementing SharePoint are you school.

    http://www.twynhamschool.com/supportinglearning/

    Posted May 14 2008, 04:50 PM by apearce with no comments
    Filed under: ,
  • Silverlight 2 Application to enable/disable your proxy server in IE

    I've been playing around a lot with Silverlight 2 recently, I'm find it a lot easier to code than version 1.

    In many of the schools I have been to, they have had a proxy server for all their internet traffic.  I created a bat script that wrote to the registry and asked the user to either type 1 to turn the proxy on or 0 for off.  It worked great but wasn't easy on the eye and one network I went to it stopped the users from using command lines.

    @echo off

    Echo.
    echo.
    Echo                     Please type the following
    echo.
    echo ----------------------------------------------------------------
    echo ----------------------------------------------------------------
    Echo ---      Proxy server must be enabled to work in school      ---
    echo --- Type '1' if you wish to enable internet access in school ---
    echo ----------------------------------------------------------------
    Echo ---       Proxy server must be disabled to work at home      ---
    Echo ---     Type '0' If you wish to disable the proxy server     ---
    echo ----------------------------------------------------------------
    echo ----------------------------------------------------------------
    Echo.
    Echo.
    Set /p inet=   Type 'Number 1' or 'Number 0' here:

    reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /t REG_DWORD /v ProxyEnable /d %inet% /f
    pause

    So I thought it was time to create something that was more graphical.  It would also solve the issue of a user typing 2 on the above script and causing errors in the registry.

    So this is what we are going to create

     

    Download the Microsoft Expression Blend 2.5 March Preview (available at time of writing this post).

    Create a WPF Application and call it ProxyEnableDisable

    Add 2 buttons and name one Proxy On and the other Proxy Off

     

    Now we want to let our users know what this silverlight application can do so we'll provide them with some instructions

     

    We've done everything we need to now in Expression Blend so we need to move the project over to Visual Studio.  Make sure you save your project.

    Over on the write hand side you will see Solution 'ProxyEnableDisable'. Right click here and click on Edit in Visual Studio.

     

    This should have now opened up Visual Studio.  You will see the same layout above, down the right hand side.  Double click on Windows1.xaml.  This is the silverlight coding.  If your using Visual Studio 2008 you will see the xaml code and a graphical view of our project.

    We need to start adding come code to the buttons.  We'll give it a x:name and then add a click handler for both of the buttons.

    Find the line of code for the button with the content that is equal to Proxy On and add x:name="On".  Also type click and click on <NewEventHandler>.  This will allow us to add come C# handling code to this button.

    Your line of code should now read

    <Button HorizontalAlignment="Left" Margin="105,201,0,193" Width="150" Content="Proxy On" x:Name="On" Click="On_Click" />

    Do the same for the Proxy Off button but instead of giving the x:name the value of On - call it off

    This is the last bit of XAML coding for this project.  The window1.xaml should now read

    <Window
        xmlns="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="Proxy_Enable.Window1"
        x:Name="Window"
        Title="Window1"
        Width="640" Height="480">

        <Grid x:Name="LayoutRoot">
            <Button HorizontalAlignment="Left" Margin="105,201,0,193" Width="150" Content="Proxy On" x:Name="On" Click="On_Click" />
            <Button HorizontalAlignment="Right" Margin="0,201,145,193" Width="150" Content="Proxy Off" x:Name="Off" Click="Off_Click" />
            <TextBox Margin="105,78,145,0" VerticalAlignment="Top" Height="101" Text="For you to use your laptop away from school you require the proxy server to be turned off.  Click on Proxy Off.&#xd;&#xa;&#xd;&#xa;For you to use your laptop at school you require the proxy server to be turned on.  Click on Proxy On." TextWrapping="Wrap"/>
        </Grid>
    </Window>

    Expand the Windows1.xaml and click on windows1.xaml.cs

    We're now going to add some C# coding that will write to our registry to either add turn the proxy on or off depending on which button the user clicks on.

     

    We need to add a reference to our C# code.  At the top add Using Microsoft.Win32;

    The below code will turn the proxy server on.  The 4th line down is where you are telling the registry to either have the proxy server enable or disabled.  The value of 1 will turn the proxy on where 0 will disable it.  Add the line of code to both of your button event handlers remembering to change that 1 to 0 for proxy off.

    RegistryKey RegKeyWrite = Registry.CurrentUser;
               RegKeyWrite = RegKeyWrite.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
               RegKeyWrite.SetValue("ProxyEnableScript", "TRUE");
               RegKeyWrite.SetValue("ProxyEnable", 1);
               RegKeyWrite.Close();

               RegistryKey RegKeyRead = Registry.CurrentUser;
               RegKeyRead = RegKeyRead.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
               Object regSuccessful = RegKeyRead.GetValue("ProxyEnableScript");
               Object regAttemptNumber = RegKeyRead.GetValue("ProxyEnable");
               RegKeyRead.Close();

               if ((string)regSuccessful == "TRUE")
                   Console.WriteLine("Succeeded on attempt # {0}", regAttemptNumber);

    If you press F5 now you will be able to turn your proxy server on and off with a simple application

     

    Now its all yours to be customised.

    Don't forget to install Silverlight 2 on your clients before rolling it out.

    Click here to download the bat file

    Click here to download the application

    Click here to download the source code

    Technorati Tags: ,
  • SharePoint Educational Vendor Day: 21st May

    Microsoft Education UK are running a vendor days on the 21st May in Reading.  It should be a really good day as they have arranged for 23 different companies to come and talk about their SharePoint solutions including companies such as RM, ITWorx, LP+ and Nisai Academy.

    Some of these including fully hosting products, in house products, library systems and VLEs (Virtual Learning Environments).  Here is a full list of all the vendors that I have taken from the Microsoft UK Schools Blog.

    1. Nisai Virtual Academy

    2. MicroLibrarian Systems – Eclipse

    3. RM – Kaleidos Learning Platform

    4. Hunterstone/ER4L – eLibrarian and Content Server

    5. Scholaris Learning Gateway

    6. Etech – StudyWiz

    7. Parabola Marking Records

    8. Business Insights Group – Student Billing

    9. ITWorx – Catalyst Provisioning (MLG)

    10. LP+ Learning Gateway

    11. Arc – Vitaelity ePortfolio

    12. NetMedia Education – MyClasses

    13. eLearningForce – SharePoint LMS

    14. Fronter VLE

    15. WinVision – Digital Portfolio

    16. Core Education – Talmos Primary

    17. Cambridge University Press – Global Grid for Learning

    18. Morse - Wisdom

    19. eCopy

    20. Digi-Link – Revelation

    21. K2 – K2 Workflow

    22. Houghton Mifflin – Learning Village

    23. Visual Software – SIF Agent Wizard and Zone Integration Server

    If you want to attend click here and book for free.

    See you there


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts