How to access unpublished content from usercontrol Options
chimnit
Posted: Monday, February 11, 2008 1:16:19 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 52
Hi Everybody

I'm trying to create a usercontrol for the umbraco backend using the IUsercontrolDataEditor interface, containing a flash-component. The flash-component need to access the unpublished node, which I have done by passing a URL into the flash-component. The document returns some XML, but I cannot get it to work. I have tried to pass in the preview address, which looks something like this:

http://www.domain.net/1050.aspx?umbVersion=ac15b364-79fc-4779-9192-f54c0fcfe3c9

Which works fine when clicking the preview button, but it does not work when accessed from other browsers.

Is umbraco checking the referer or something like that for previews? Is there a way I can access the page content in its preview state by e.g. passing an extra parameter in the preview querystring?

Thank a lot in advance.

Kim
chimnit
Posted: Monday, February 11, 2008 2:10:52 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 52
Hi again

It seems umbraco needs a user contextid. When I try to access the document with the folowing URL:

/1050.aspx?umbVersion=ac15b364-79fc-4779-9192-f54c0fcfe3c9

I get an exception: The user han no umbraco contextid.

Now I have altered my request so that in the code I do the following

Code:
protected void Page_Load(object sender, EventArgs e)
        {
            int currentDoc = Int32.Parse(Request["id"]);

            Document doc = new Document(currentDoc);
            string docVersion = doc.Version.ToString();
           
            string contextId = umbraco.BasePages.BasePage.umbracoUserContextID;
            litFlashScript.Text = GenerateFlashScript(string.Format("/{0}.aspx?umbVersion={1}&contextid={2}", currentDoc, docVersion, contextId));
        }



Thereby the URL I try to access looks something like this:

/1050.aspx?umbVersion=ac15b364-79fc-4779-9192-f54c0fcfe3c9&contextid=04a19fdb-0e18-4705-a051-4844ed5379e4

But now I get the following exception:
Code:

User has timed out!!
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: User has timed out!!


Anybody who might have an idea what to do???

Thanks a lot :o)

/Kim
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.