Microsoft Content Management Server - webauthor control to set ordinality of a posting

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > March 2006 > webauthor control to set ordinality of a posting





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author webauthor control to set ordinality of a posting
drazic19

2006-03-15, 5:52 pm

Hi,

Been trying to create a control to set the ordinality of a posting from the
webauthor, could someone help, point me in the right direction etc.

Code so far is:

Public Class MovePostingUp : Inherits BasePostbackAction

Dim currentOrdinality As Integer

Private Sub moveUp()
Try
Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
Dim cmsPosting As Posting = cmsContext.Posting
currentOrdinality = cmsPosting.SortOrdinal

If (currentOrdinality <> 0) Then
currentOrdinality = currentOrdinality - 1
Else
currentOrdinality = currentOrdinality
End If

If (cmsContext.Mode <> PublishingMode.Update) Then
'Me.Page.Response.Redirect(cmsPosting.UrlModeUpdate, True)
cmsPosting.SortOrdinal = currentOrdinality
cmsContext.CommitAll()
End If

'Me.Page.Response.Redirect(cmsPosting.UrlModeUnpublished,
True)

Catch ex As Exception

End Try

End Sub

Public Overrides Property Text() As String
Get
moveUp()
Return "Move Up Order " + currentOrdinality.ToString
End Get
Set(ByVal Value As String)

End Set
End Property

Public Overloads Overrides ReadOnly Property Available() As Boolean
Get
Return CmsHttpContext.Current.Channel.CanCreatePostings
End Get
End Property

End Class

Any help would be great thanks,

Michael
Stefan [MSFT]

2006-03-16, 7:48 am

Hi Michael,

a solution for this already exists:
http://www.gotdotnet.com/Community/...C9-C7378FB0FDBB

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:472E6648-CD77-4AE7-8D1B-1A2EDA9D5FC2@microsoft.com...
> Hi,
>
> Been trying to create a control to set the ordinality of a posting from
> the
> webauthor, could someone help, point me in the right direction etc.
>
> Code so far is:
>
> Public Class MovePostingUp : Inherits BasePostbackAction
>
> Dim currentOrdinality As Integer
>
> Private Sub moveUp()
> Try
> Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
> Dim cmsPosting As Posting = cmsContext.Posting
> currentOrdinality = cmsPosting.SortOrdinal
>
> If (currentOrdinality <> 0) Then
> currentOrdinality = currentOrdinality - 1
> Else
> currentOrdinality = currentOrdinality
> End If
>
> If (cmsContext.Mode <> PublishingMode.Update) Then
> 'Me.Page.Response.Redirect(cmsPosting.UrlModeUpdate,
> True)
> cmsPosting.SortOrdinal = currentOrdinality
> cmsContext.CommitAll()
> End If
>
> 'Me.Page.Response.Redirect(cmsPosting.UrlModeUnpublished,
> True)
>
> Catch ex As Exception
>
> End Try
>
> End Sub
>
> Public Overrides Property Text() As String
> Get
> moveUp()
> Return "Move Up Order " + currentOrdinality.ToString
> End Get
> Set(ByVal Value As String)
>
> End Set
> End Property
>
> Public Overloads Overrides ReadOnly Property Available() As Boolean
> Get
> Return CmsHttpContext.Current.Channel.CanCreatePostings
> End Get
> End Property
>
> End Class
>
> Any help would be great thanks,
>
> Michael



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com