Publish vs Newest Options
oen
Posted: Tuesday, September 04, 2007 8:00:33 PM
Rank: Enthusiast

Joined: 8/17/2007
Posts: 12
Imagine this scenario:

table cmsdocument
nodeid Published documentUser VersionId Text releaseDate expireDate updateDate templateId alias newest
1259 1 0 3E3DFEAB-DDDC-4D7B-8B50-32C13817CE26 Quentes NULL NULL 2007-09-04 18:13:00.000 1131 NULL 0
1259 0 0 CC3F4964-0CE8-4BB0-9989-750D29C7A183 Quentes NULL NULL 2007-09-04 18:13:00.000 1131 NULL 1

why every time e do umbraco.library.GetXmlNodeCurrent(); e get a XML, and the version in that xml is CC3F4964-0CE8-4BB0-9989-750D29C7A183, the newest entry, shouldn't I get
a xml with version 3E3DFEAB-DDDC-4D7B-8B50-32C13817CE26, the publish document.

More...

if I do this

Document doc = new Document(1259);
Property prop = doc.getProperty(PortalConstants.SubCategorySmallDescriptionAlias);

the value in prop is the newest value and not the published value.

I need to know this, am i doing any thing wrong? shouldn't i get the published document why am i get the newest and not the published

another thing in table umbracoUser why password are in clear text, shouldn't this password be encrypted?
oen
Posted: Tuesday, September 04, 2007 8:14:16 PM
Rank: Enthusiast

Joined: 8/17/2007
Posts: 12
one other thing Node.GetCurrent(); gives me the same information about version...


how can i get the published document and not the newest document?
oen
Posted: Tuesday, September 04, 2007 8:30:14 PM
Rank: Enthusiast

Joined: 8/17/2007
Posts: 12
I am digging a little more and found that one of the queries executed was:

Select top 1 VersionId from cmsContentVersion where contentID = 1259 order by id desc

if I do Select * from cmsContentVersion where contentID = 1259 order by id desc

to see all the record this came up:

2916 1259 CC3F4964-0CE8-4BB0-9989-750D29C7A183 2007-09-04 18:17:11.390
2915 1259 3E3DFEAB-DDDC-4D7B-8B50-32C13817CE26 2007-09-04 18:13:22.920

2916 -> the newest
2915 -> the published

then it executes this queries

select published, documentUser, isnull(templateId, cmsDocumentType.templateNodeId) as templateId, text, releaseDate, expireDate, updateDate from cmsDocument inner join cmsContent on cmsDocument.nodeId = cmsContent.Nodeid left join cmsDocumentType on cmsDocumentType.contentTypeNodeId = cmsContent.contentType and cmsDocumentType.IsDefault = 1 where versionId = 'cc3f4964-0ce8-4bb0-9989-750d29c7a183'

0 0 1131 Quentes NULL NULL 2007-09-04 18:13:00.000

select Count(published) as tmp from cmsDocument where published = 1 And nodeId = 1259

1
oen
Posted: Wednesday, September 05, 2007 11:45:14 AM
Rank: Enthusiast

Joined: 8/17/2007
Posts: 12
Can any one help me?
oen
Posted: Thursday, September 06, 2007 12:29:54 PM
Rank: Enthusiast

Joined: 8/17/2007
Posts: 12
Tip: after digging a little more i have found that the published content I want can be accessed using the type page and the iterate in hashtable Elements
where I have all my property values.

Note: the type Document is used to create, modify and consult the newest version and other things

To consult published content just use the page...


page p = new page(((IHasXmlNode)umbraco.library.GetXmlNodeById(UmbracoNodeHelper.CurrentNode.Id.ToString()).Current).GetNode());

String tempElementContent_p = p.Elements["PageName"].ToString();


page umbPage = new page(((IHasXmlNode)umbraco.library.GetXmlNodeCurrent().Current).GetNode());

String tempElementContent_umbPage = umbPage.Elements["PageName"].ToString();
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.