Using the Community Server Gallery Photo Order Service

The Photo Ordering service has been around in Community Server forever.  I didn’t know it was still available, but a client asked for it recently so I went searching for legacy bits in the SDK to bring it out of retirement.  For how long it will be functional with the impending release of CS2008 and the merging of the File and Photo galleries into a single Media Gallery is not known, but confidence is not high.  And since there are probably only 2 Community Server sites in the world using this feature, I’ll make this post short.

A quick SiteUrls.config review finds a gallery_ViewOrderPrints url available, but as an orphaned url, it simply doesn’t work anymore.  The resulting url is http://mycoolcssite.com/photos///order.aspx.  Fortunately we can fill in the blanks by rolling our own path to order.aspx, which is the trick.

 

<script language=”C#” runat=”server”>

    private string orderUrl;

    public string OrderUrl
    {
        get { return orderUrl; }
        set { orderUrl = value; }
    }
    void Page_Load()
    {
        if (CurrentGallery != null)
            SetTitle(CurrentGallery.Name, true);

        OrderUrl = http://mycoolcssite.com/photos/ + CurrentCSContext.ApplicationKey + “/” + CurrentGalleryPost.PostID + “/order.aspx”;

    }

</script>

   <div style=”margin-top: 20px;”>
                <a href='<%= OrderUrl %>’>Order this photo!</a>
            </div>       
                <div style=”margin-top: 20px;”>
                 <!– The following would appear to be correct, but doesn’t do it for us –>
                <CSControl:SiteUrl UrlName=”gallery_ViewOrderPrints” runat=”Server”
                       Parameter1='<%= CurrentCSContext.ApplicationKey %>’
                       Parameter2='<%=  CurrentGalleryPost.PostID %>’ Text=”Order it again!” />
    </div> 

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.