Microsoft Content Management Server - Custom XmlPlaceholder

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > November 2006 > Custom XmlPlaceholder





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 Custom XmlPlaceholder
Goran

2006-11-22, 1:15 pm

Hi!

I have a UserControl in which I list out articles with a Repeater.
Information for the repeater is inside the XmlPlaceholder. Here I move
articles by switching rows inside the DataSet ([0]DataTable). This
UserControl is then wrote to my Web Form (Cms template).
I've made a Custom XML Placeholder to be able to save changes made in
DataSet inside XmlPlaceholder. But how am I supposed to make it work with the
other two, "Listing UserControl" and "Cms template"? I dont' need
communication between Custom XML Placeholder and Listing UserControl.
Stefan Goßner [MSFT]

2006-11-22, 1:15 pm

Hi Goran,

you are mixing up terms: You custom code is not a custom placeholder but a
custom placeholder control.

In addition: I don't understand what you are looking for. A placeholder
control is always intended to load and save content into the bound
placeholder object.
What kind of additional functionality are you looking for?

Cheers,
Stefan

"Goran" <Goran@discussions.microsoft.com> wrote in message
news:5496FDBB-5C42-4526-BB98-D529A5D20533@microsoft.com...
> Hi!
>
> I have a UserControl in which I list out articles with a Repeater.
> Information for the repeater is inside the XmlPlaceholder. Here I move
> articles by switching rows inside the DataSet ([0]DataTable). This
> UserControl is then wrote to my Web Form (Cms template).
> I've made a Custom XML Placeholder to be able to save changes made in
> DataSet inside XmlPlaceholder. But how am I supposed to make it work with
> the
> other two, "Listing UserControl" and "Cms template"? I dont' need
> communication between Custom XML Placeholder and Listing UserControl.



Goran

2006-11-22, 1:15 pm

Thank you for your fast reply Stefan.

My application works this way:

- Listing UserControl loads xml from XmlPlaceholder to a DataSet and writes
its content out with help from a Repeater (DataSet got GUIs and sorting of
articles)
- UserControl shows in my Web Form and displays articles on the site
- I need a Custom XML Placeholder to be able to "Save" dataset from Listing
UserControl to Xml Placeholder. Then later another user can Approve Saved
information.

I'm interested in overriding Saving of XmlPlaceholder and in that way to
store DataSet without needing to Approve it right away. I'm using Custom Xml
Placeholder from
http://www.geekswithblogs.com/jawad...derControl.aspx .

~Goran

"Stefan Goßner [MSFT]" wrote:

> Hi Goran,
>
> you are mixing up terms: You custom code is not a custom placeholder but a
> custom placeholder control.
>
> In addition: I don't understand what you are looking for. A placeholder
> control is always intended to load and save content into the bound
> placeholder object.
> What kind of additional functionality are you looking for?
>
> Cheers,
> Stefan
>
> "Goran" <Goran@discussions.microsoft.com> wrote in message
> news:5496FDBB-5C42-4526-BB98-D529A5D20533@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2006-11-22, 1:15 pm

Hi Goran,

if the posting requires approval, then it is not possible to change the
placeholder content without needing approval.
This is nothing that can be controlled by a custom placeholder control or a
custom placeholder definition.

Cheers,
Stefan

"Goran" <Goran@discussions.microsoft.com> wrote in message
news:0113BD65-8BBC-4017-AF49-1AB0B977EE74@microsoft.com...[vbcol=seagreen]
> Thank you for your fast reply Stefan.
>
> My application works this way:
>
> - Listing UserControl loads xml from XmlPlaceholder to a DataSet and
> writes
> its content out with help from a Repeater (DataSet got GUIs and sorting of
> articles)
> - UserControl shows in my Web Form and displays articles on the site
> - I need a Custom XML Placeholder to be able to "Save" dataset from
> Listing
> UserControl to Xml Placeholder. Then later another user can Approve Saved
> information.
>
> I'm interested in overriding Saving of XmlPlaceholder and in that way to
> store DataSet without needing to Approve it right away. I'm using Custom
> Xml
> Placeholder from
> http://www.geekswithblogs.com/jawad...derControl.aspx .
>
> ~Goran
>
> "Stefan Goßner [MSFT]" wrote:
>


Goran

2006-11-23, 7:28 am

So what you're saying is that there isn't a way to support XmlPlaceholder
with same usability as HtmlPlaceholders have!?
Are there several versions of a HtmlPlaceholder for respectivly "Saved
Content" and "Published Content" ? Because this is what I'm aiming at with my
XmlPlaceholder.

"Stefan Goßner [MSFT]" wrote:

> Hi Goran,
>
> if the posting requires approval, then it is not possible to change the
> placeholder content without needing approval.
> This is nothing that can be controlled by a custom placeholder control or a
> custom placeholder definition.
>
> Cheers,
> Stefan
>
> "Goran" <Goran@discussions.microsoft.com> wrote in message
> news:0113BD65-8BBC-4017-AF49-1AB0B977EE74@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2006-11-23, 7:28 am

Hi Goran,

no it is the same for all kinds of placeholders.
Whenever you do a change to any kind of placeholder and you require approval
for the posting these placeholder are in you will need approval.
There is no difference between XmlPlaceholders and HtmlPlaceholders.

And yes: there are several versions for the placeholder content.
There is always a published version (if the posting has been approved
before) and potentially a version which is not yet published (if you updated
the placeholder).

Cheers,
Stefan

"Goran" <Goran@discussions.microsoft.com> wrote in message
news:57C28D7F-D504-4A1A-848B-7D1A1EC5E447@microsoft.com...[vbcol=seagreen]
> So what you're saying is that there isn't a way to support XmlPlaceholder
> with same usability as HtmlPlaceholders have!?
> Are there several versions of a HtmlPlaceholder for respectivly "Saved
> Content" and "Published Content" ? Because this is what I'm aiming at with
> my
> XmlPlaceholder.
>
> "Stefan Goßner [MSFT]" wrote:
>


Goran

2006-11-27, 7:20 am

Thanks for another fast reply Stefan!

I'll take this one from the start.

I have a Web Form where my User Control is listing out articles. This is
done with help from a Repeater and a DataView that's made from a DataTable
I'm using. This DataTable contains main articles chosen from a user in edit
mode. DataTable is also dynamic in a sense that expired articles will be
removed next time it runs.

My intention is to be able to store this DataTable (DataSet in XML) inside
the XmlPlaceholder. I also want CMS standard usabillity where I have a
version that's published version (if the posting has been approved before)
and potentially a version which is not yet published (if placeholder is
updated).

Does XmlPlaceholder provide this usabillity, and does it get the right
version when I ask for XmlPlaceholders content from different modes like
mentioned above?

Do I really have to override XmlPlaceholder Control?

If I choose to Save and Exit and than Publish in same operation the
DataTable (DataSet in XML) IS actually stored in published version. What it
doen't seem to handle is just storing a potential version which is not yet
published.


"Stefan Goßner [MSFT]" wrote:

> Hi Goran,
>
> no it is the same for all kinds of placeholders.
> Whenever you do a change to any kind of placeholder and you require approval
> for the posting these placeholder are in you will need approval.
> There is no difference between XmlPlaceholders and HtmlPlaceholders.
>
> And yes: there are several versions for the placeholder content.
> There is always a published version (if the posting has been approved
> before) and potentially a version which is not yet published (if you updated
> the placeholder).
>
> Cheers,
> Stefan
>
> "Goran" <Goran@discussions.microsoft.com> wrote in message
> news:57C28D7F-D504-4A1A-848B-7D1A1EC5E447@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2006-11-27, 1:16 pm

Hi Goran,

yes this is the same for all kind of placeholders. The XmlPlaceholder is no
exception.

No you don't have to override the XmlPlaceholder control as there is no such
control in MCMS.
You need to create your own one.

When you save the placeholder it will be stored in the unpublished version.
But be aware that the next regular save of your posting will change the
unpublished version including all placeholders (including the Xml
placeholder one) to the published version.
You cannot prevent one placeholder not to be published.

Cheers,
Stefan


"Goran" <Goran@discussions.microsoft.com> wrote in message
news:6AB81BAE-F248-445B-BE15-AA4AB77D0841@microsoft.com...[vbcol=seagreen]
> Thanks for another fast reply Stefan!
>
> I'll take this one from the start.
>
> I have a Web Form where my User Control is listing out articles. This is
> done with help from a Repeater and a DataView that's made from a DataTable
> I'm using. This DataTable contains main articles chosen from a user in
> edit
> mode. DataTable is also dynamic in a sense that expired articles will be
> removed next time it runs.
>
> My intention is to be able to store this DataTable (DataSet in XML) inside
> the XmlPlaceholder. I also want CMS standard usabillity where I have a
> version that's published version (if the posting has been approved before)
> and potentially a version which is not yet published (if placeholder is
> updated).
>
> Does XmlPlaceholder provide this usabillity, and does it get the right
> version when I ask for XmlPlaceholders content from different modes like
> mentioned above?
>
> Do I really have to override XmlPlaceholder Control?
>
> If I choose to Save and Exit and than Publish in same operation the
> DataTable (DataSet in XML) IS actually stored in published version. What
> it
> doen't seem to handle is just storing a potential version which is not yet
> published.
>
>
> "Stefan Goßner [MSFT]" wrote:
>


Goran

2006-11-27, 1:16 pm

I've just found out that storing a potential version which is not yet
published WORKS!

What doesn't work is actually getting this version when I'm in "Edit" mode.

"CmsHttpContext.Current.Posting.Placeholders[XMLPH] as XmlPlaceholder" gets
the published version every time. Any idea what I should use here to get the
right version here?
Stefan Goßner [MSFT]

2006-11-27, 1:16 pm

Hi Goran,

this should give you the unpublished version.
Please check CmsHttpContext.Current.Mode in the line before accessing the
placeholder - are you really in unpublished mode?

Cheers,
Stefan


"Goran" <Goran@discussions.microsoft.com> wrote in message
news:22257242-AA6B-40C6-99BA-2D849608D6C2@microsoft.com...
> I've just found out that storing a potential version which is not yet
> published WORKS!
>
> What doesn't work is actually getting this version when I'm in "Edit"
> mode.
>
> "CmsHttpContext.Current.Posting.Placeholders[XMLPH] as XmlPlaceholder"
> gets
> the published version every time. Any idea what I should use here to get
> the
> right version here?



Goran

2006-11-27, 1:16 pm

I just checked! And I was in unpublished mode, but version of XmlPlaceholder
that was fetched was still the published one... :/



"Stefan Goßner [MSFT]" wrote:

> Hi Goran,
>
> this should give you the unpublished version.
> Please check CmsHttpContext.Current.Mode in the line before accessing the
> placeholder - are you really in unpublished mode?
>
> Cheers,
> Stefan
>
>
> "Goran" <Goran@discussions.microsoft.com> wrote in message
> news:22257242-AA6B-40C6-99BA-2D849608D6C2@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2006-11-27, 1:16 pm

Hi Goran,

this should not happen.
Please open a support case for this.

Cheers,
Stefan


"Goran" <Goran@discussions.microsoft.com> wrote in message
news:3DA0A9C8-85E5-4DFA-88EF-1AD37740178F@microsoft.com...[vbcol=seagreen]
>I just checked! And I was in unpublished mode, but version of
>XmlPlaceholder
> that was fetched was still the published one... :/
>
>
>
> "Stefan Goßner [MSFT]" wrote:
>


Goran

2006-11-28, 1:16 pm

My own programming logic was the problem. I've solved it now. And yes, you're
absolutely correct when it comes to use of: storings/fetching procedure
to/from XmlPlaceholder. It always takes care of getting the version that is
correct considering mode you're in.

Thank you for all your help. I'm sorry that I'm not (yet) so good in
explaining a CMS case.

"Stefan Goßner [MSFT]" wrote:

> Hi Goran,
>
> this should not happen.
> Please open a support case for this.
>
> Cheers,
> Stefan
>
>
> "Goran" <Goran@discussions.microsoft.com> wrote in message
> news:3DA0A9C8-85E5-4DFA-88EF-1AD37740178F@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2006-11-28, 1:16 pm

Hi Goran,

no problem!
:-)

Cheers,
Stefan


"Goran" <Goran@discussions.microsoft.com> wrote in message
news:45DB9CB1-FE62-4F52-B4FD-BCCF2D59D084@microsoft.com...[vbcol=seagreen]
> My own programming logic was the problem. I've solved it now. And yes,
> you're
> absolutely correct when it comes to use of: storings/fetching procedure
> to/from XmlPlaceholder. It always takes care of getting the version that
> is
> correct considering mode you're in.
>
> Thank you for all your help. I'm sorry that I'm not (yet) so good in
> explaining a CMS case.
>
> "Stefan Goßner [MSFT]" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com