Hi Jian,
Sorry - did not know that it was undocumented. In honesty I didn't even
look at the documentation, nor did I try it so it may not work. Equally the
below may or may not work - you'd have to try it.
Regards the "custom render tag" - I wasn't suggesting to use the custom
render tag to execute RQL. A PageBuildContext object is passed into the
"OnGetObject" method of a custom Loader as a parameter. That
PageBuildContext has a property "Session" (which annoyingly and for no good
reason is marked "internal" so.) you can't use it. officially. You can use
reflection to get it though. Another way, is to use the static
Session.GetSystemSession( Guid projectId, string languageId, string
dialogLanguageId ). You can get the ProjectId and language from the
PageBuildContext I mentioned before, something like this:
Session s = Session.GetSystemSession( context.ProjectId,
context.Language.Key, context.Language.Key );
The Session object then has (at least) all these properties:
public IList AnalyzeData { get; }
public string AspDirectory { get; }
public DateTime ChangeTime { get; }
public DataLoadState DataLoadState { get; set; }
public string DialogLanguageId { get; }
public bool ForAspx { get; set; }
public bool IgnoreLinkingSchedule { get; set; }
internal static IniReader IniReader { get; }
public bool IsAnalyzeSession { get; }
public bool IsImporter { get; set; }
public bool IsPublishSession { get; set; }
public bool IsSystemSession { get; }
public bool IsTranslationMode { get; set; }
public bool IsValid { get; }
public bool IsWebCompliance { get; set; }
public string LanguageKey { get; }
public Guid LoginId { get; }
public DateTime LoginTime { get; }
public static XmlDocument MainConfig { get; }
public IDictionary Params { get; }
public int Preview { get; set; }
public string PreviewUrl { get; set; }
public Guid ProjectId { get; }
public DateTime PublishingTime { get; set; }
public string SessionKey { get; }
public string SourceLanguageID { get; set; }
public string TargetLanguageID { get; set; }
public string ThemePath { get; set; }
public bool UseCache { get; set; }
public bool UsePublishingTime { get; set; }
public Guid UserId { get; }
public static string VirtualPath { get; }
public bool WithTempSaved { get; set; }
Probably all of that is unofficial in hindsight - forget I mentioned it.
You can't do it.
HTH
Richard H.
From: [email protected]
[mailto:[email protected]] On Behalf Of Jian Huang
Sent: Friday, 1 March 2013 1:26 AM
To: [email protected]
Subject: Re: Getting login information in Custom Render Tag
Hi everyone,
I would not use Context:CurrentUserId inside any content class templates
because it is a rendertag listed in the official navigation manager
documentation. Support can refuse support on anything that is undocumented.
HOWEVER, if you use within Custom Rendertag code, well, I think it has to be
supported because the OpenText rendertag object do expose that property.
Since version 9, sessionkey and loginguid is the same, CurrentUserId is
something else, something not the same or related.
RQL from custom rendertag...to do or not to do. Well, the custom rendertag
documentation explicitly says no because it may cause application deadlocks.
Well, same thing was said about RQL and preexecution. In the RQL and
preexecution case, action="save" RQL may cause deadlocks, query only ones
seems to be ok. Hope it is the same for RQL and custom rendertag.
The OpenText US Consultant team is undecided on the best practice regarding
custom rendertag. It is a beautiful and powerful thing and we wanted to use
it. However, just like it was with preexecution, we later found it to be a
something that would make a project slow and nightmare to maintain/hand over
to client properly.
Hilmar, sir, it seems like you are in the same exploration phase as we are.
Please, post back to the forum, here or solutionexchange about your
findings.
Thank you,
-Jian
On Thursday, February 28, 2013 1:03:59 AM UTC-5, Richard Hauer (5 Limes)
wrote:
Hi Wolfgang, Hilmar,
The "ultimate list" page - which is getting somewhat out of date now - has
those values in the "Session" object (at the very bottom of the tables near
the bottom of the page).
You might have some luck with:
<%!! Context:CurrentUserId !!%>
If memory serves the SessionKey and LogonGuid are really just the UserId
Guid in recent versions (>= v9)
As far as I can see there is very little that exposes the Session object,
though many types use it.
A custom render tag to expose these values would be trivial.
HTH
Richard H.
From: [email protected] <javascript:>
[mailto:[email protected] <javascript:> ] On Behalf Of Wolfgang
Roiter
Sent: Wednesday, 27 February 2013 7:06 PM
To: [email protected] <javascript:>
Subject: Re: Getting login information in Custom Render Tag
Hi Hilmar,
unfortunately not. Even the "ultimate list" does not mention any solution
how to retrieve session information:
http://www.reddotcmsblog.com/reddot-cms-render-tags-the-ultimate-list
But why don't you use the info elements?
Regards, Wolfgang
--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected] <javascript:> .
To post to this group, send email to [email protected]
<javascript:> .
Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected]
<mailto:[email protected]> .
To post to this group, send email to [email protected]
<mailto:[email protected]> .
Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.