Don't know why I thought yesterday was Friday. Wishful thinking I guess.
Just employeed your recommendation a works beautifully.
Thanks for hanging with me.
Was able to reduce the code to a single function. Gotta like that!
On Thu, Jul 1, 2010 at 4:59 PM, Bill Rishsew <[email protected]> wrote:

> hmmmm, I like that. I'll give it a go on Tuesday. Thanks for the amazing
> assistance.
>
>
> On Thu, Jul 1, 2010 at 3:51 PM, Wayne Bouwmeester <
> [email protected]> wrote:
>
>> The term we use for an external asp file is "plugin"
>> It's usually put in the asp/plugins directory.
>> I'm not exactly sure what you are doing since you call it an external
>> file but you must be including it somewhere so that your in-template
>> call can find it.
>> is all that code you wrote in a content class or in a physical file on
>> the server?
>>
>> However you're doing, it, just add the render tag I gave you into your
>> call as one of the parameters.
>> It should work since it will be replaced before the call is made with
>> the real guid.
>>
>> <%=strLinkingScheduleBanner("<%info_LiveChatSessionKey%>","<
>> %info_LiveChatLoginGUID%>", "<%info_LiveChatPageGUID%>", <%!!
>> Context:CurrentMasterPage.Id> !!%>)%>
>>
>>
>>
>> On Jul 1, 4:05 pm, Bill Rishsew <[email protected]> wrote:
>> > Not sure what you mean by plugin.
>> > What I've done is write a separate ASP page with a few functions in it.
>> > I then call the function from within the Template where I can gather the
>> > unigue values required by the function.
>> > I've included examples below.
>> > Just seems like I should be able to grab the outermost page guid.
>> > I checked for Session Variables and didn't find any. You know of some?
>> > Better way to do this?
>> >
>> > *In the Template*
>> >
>> >
>> <!IoRangeRedDotMode><%=strLinkingScheduleBanner("<%info_LiveChatSessionKey%>",
>> > "<%info_LiveChatLoginGUID%>", "<%info_LiveChatPageGUID%>")%><
>> > !/IoRangeRedDotMode>
>> >
>> > *In the External ASP File*
>> >
>> > <%
>> >   Function xmlPage(XMLString)
>> >     set objData = server.CreateObject("RDCMSASP.RdPageData") ' *
>> >     objData.XMLServerClassname="RDCMSServer.XmlServer" ' *
>> >     xmlPage = objData.ServerExecuteXML(XMLString, sErrors)
>> >   End Function
>> >
>> >   Function DecodeDate(OldDate)
>> >     Dim objIO
>> >     Set objIO = CreateObject("RDCMSAsp.RDPageData")
>> >     DecodeDate = objIO.decodedate(OldDate)
>> >   End Function
>> >
>> >   Function getParentPageGUID(strSessionKey, strLoginGUID, strPageGUID)
>> >     XMLString = ""
>> >     XMLString = XMLString & "<IODATA loginguid='" & strLoginGUID & "'
>> > sessionkey='" & strSessionKey & "' format='0'>"
>> >     XMLString = XMLString & "  <PAGE action='load' guid='" & strPageGUID
>> &
>> > "' />"
>> >     XMLString = XMLString & "</IODATA>"
>> >     xmlFile = xmlPage(XMLString)
>> >     Response.Write("<!-- " & strPageGUID & " -->") & vbCrLf
>> >     Response.Write("<!-- " & xmlFile & " -->")
>> >     Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
>> >     xmlDoc.loadXML(xmlFile)
>> >     Set RDxmlNodeList = xmlDoc.getElementsByTagName("PAGE")
>> >     getParentPageGUID = RDxmlNodeList(0).getAttribute("parentguid")
>> >   End Function
>> >
>> >   Function strLinkingSchedule(strSessionKey, strLoginGUID,
>> strLinkPageGUID,
>> > strParentPageGUID)
>> >     If strSessionKey = "" Or strLoginGUID = "" Or strLinkPageGUID = ""
>> Then
>> >       strLinkingSchedule = "[<img src='
>> http://reddot/cms/Icons/TimeState.gif'
>> > align='absmiddle' style='display:inline' /> Linking information not
>> > available]"
>> >     Else
>> >       XMLString = ""
>> >       XMLString = XMLString & "<IODATA sessionkey='" & strSessionKey &
>> "'
>> > loginguid='" & strLoginGUID & "'>"
>> >       XMLString = XMLString & "  <PAGE guid='" & strLinkPageGUID & "'>"
>> >       XMLString = XMLString & "    <LINKSFROM action='load' />"
>> >       XMLString = XMLString & "  </PAGE>"
>> >       XMLString = XMLString & "</IODATA>"
>> >       xmlFile = xmlPage(XMLString)
>> >       Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
>> >       xmlDoc.loadXML(xmlFile)
>> >       Set RDxmlNodeList = xmlDoc.getElementsByTagName("LINK")
>> >       If RDxmlNodeList.length > 0 Then
>> >         For x = 0 to (RDxmlNodeList.length - 1)
>> >           strCurrentPageGUID = RDxmlNodeList(x).getAttribute("pageguid")
>> >           If (StrComp(strCurrentPageGUID, strParentPageGUID, 1) = 0)
>> Then
>> >             With RDxmlNodeList(x)
>> >               RdBeginDate = .getAttribute("datebegin")
>> >               RdEndDate   = .getAttribute("dateend")
>> >               RdDateState = .getAttribute("datestate")
>> >             End With
>> >           End If
>> >         Next
>> >         strLinkingSchedule = strLabel(RdDateState, RdBeginDate,
>> RdEndDate)
>> >       End If
>> >       'Response.Write("<!-- PageGUID: " & strLinkPageGUID & " -->") &
>> vbCrLf
>> >       'Response.Write("<!-- ParentPageGUID: " & strParentPageGUID & "
>> -->")
>> > & vbCrLf
>> >       'Response.Write("<!-- " & xmlFile & " -->")
>> >     End If
>> >   End Function
>> >
>> >   Function strLinkingScheduleBanner(strSessionKey, strLoginGUID,
>> > strPageGUID)
>> >     If strSessionKey = "" Or strLoginGUID = "" Or strPageGUID = "" Then
>> >       strLinkingScheduleBanner = "[<img src='
>> http://reddot/cms/Icons/TimeState.gif'align='absmiddle'
>> > style='display:inline' /> Linking information not available]"
>> >     Else
>> >       XMLString = ""
>> >       XMLString = XMLString & "<IODATA sessionkey='" & strSessionKey &
>> "'
>> > loginguid='" & strLoginGUID & "'>"
>> >       XMLString = XMLString & "  <PAGE guid='" & strPageGUID & "'>"
>> >       XMLString = XMLString & "    <LINKSFROM action='load' />"
>> >       XMLString = XMLString & "  </PAGE>"
>> >       XMLString = XMLString & "</IODATA>"
>> >       xmlFile = xmlPage(XMLString)
>> >       Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
>> >       xmlDoc.loadXML(xmlFile)
>> >       Set RDxmlNodeList = xmlDoc.getElementsByTagName("LINK")
>> >       strParentPageGUID = getParentPageGUID(strSessionKey, strLoginGUID,
>> > strPageGUID)
>> >       If RDxmlNodeList.length > 0 Then
>> >         For x = 0 to (RDxmlNodeList.length - 1)
>> >           strCurrentPageGUID = RDxmlNodeList(x).getAttribute("pageguid")
>> >           If (StrComp(strCurrentPageGUID, strParentPageGUID, 1) = 0)
>> Then
>> >             With RDxmlNodeList(x)
>> >               RdBeginDate = .getAttribute("datebegin")
>> >               RdEndDate   = .getAttribute("dateend")
>> >               RdDateState = .getAttribute("datestate")
>> >             End With
>> >           End If
>> >         Next
>> >         strLinkingScheduleBanner = strLabel(RdDateState, RdBeginDate,
>> > RdEndDate)
>> >       End If
>> >       Response.Write("<!-- PageGUID: " & strPageGUID & " -->") & vbCrLf
>> >       Response.Write("<!-- ParentPageGUID: " & strParentPageGUID & "
>> -->") &
>> > vbCrLf
>> >       'Response.Write("<!-- " & xmlFile & " -->")
>> >     End If
>> >   End Function
>> >
>> >   Function strLabel(RdDateState, RdBeginDate, RdEndDate)
>> >     Dim strIconMsg : strIconMsg = ""
>> >
>> >     Select Case RdDateState
>> >       Case "1"
>> >         strIconMsg = "Unlimited appearance schedule"
>> >       Case "2"
>> >         strIconMsg = "Link is not yet active"
>> >       Case "3"'
>> >         strIconMsg = "Link is active"
>> >       Case ""
>> >         strIconMsg = "An error has occurred"
>> >       Case Else
>> >         strIconMsg = "Story has expired"
>> >     End Select
>> >
>> >     If RdBeginDate = "0" Then
>> >       If RdEndDate = "0" Then
>> >         strLabel = "&nbsp;&nbsp;[<img alt='" & strIconMsg & "' src='
>> http://reddot/cms/Icons/TimeState"; & RdDateState & ".gif'
>> align='absmiddle'
>> > style=""display:inline"" /> <span style=""font-size:
>> > 7pt;"">Permanent</span>]"
>> >       Elseif RdEndDate <> "0" Then
>> >         strLabel = "&nbsp;&nbsp;[<img alt='" & strIconMsg & "' src='
>> http://reddot/cms/Icons/TimeState"; & RdDateState & ".gif'
>> align='absmiddle'
>> > style=""display:inline"" /> <span style=""font-size: 7pt;"">No start
>> date -
>> > " & DecodeDate(RdEndDate) & "</span>]"
>> >       End If
>> >     Else
>> >       If RdEndDate <> "0" Then
>> >         If RdEndDate = "" Then
>> >           strLabel = "&nbsp;&nbsp;[<img alt='" & strIconMsg & "' src='
>> http://reddot/cms/Icons/TimeState"; & RdDateState & ".gif'
>> align='absmiddle'
>> > style=""display:inline"" /> <span style=""font-size: 7pt;"">An error has
>> > occurred</span>]"
>> >         Else
>> >           strLabel = "&nbsp;&nbsp;[<img alt='" & strIconMsg & "' src='
>> http://reddot/cms/Icons/TimeState"; & RdDateState & ".gif'
>> align='absmiddle'
>> > style=""display:inline"" /> <span style=""font-size: 7pt;"">" &
>> > DecodeDate(RdBeginDate) & " - " & DecodeDate(RdEndDate) & "</span>]"
>> >         End If
>> >       Else
>> >         strLabel = "&nbsp;&nbsp;[<img alt='" & strIconMsg & "' src='
>> http://reddot/cms/Icons/TimeState"; & RdDateState & ".gif'
>> align='absmiddle'
>> > style=""display:inline"" /> <span style=""font-size: 7pt;"">" &
>> > DecodeDate(RdBeginDate) & " - No end date</span>]"
>> >       End If
>> >     End If
>> >   End Function
>> > %>
>> >
>> > On Thu, Jul 1, 2010 at 2:52 PM, Wayne Bouwmeester <
>> >
>>  > [email protected]> wrote:
>> > > Not sure where the render tag doc'n comes from - should be available
>> > > from OpenText.
>> >
>> > > Where is your ASP code? In a template or in a separate file in the
>> > > Plugins directory?
>> >
>> > > If your code is in a template, just paste the code in.
>> > > If it's in a file that you are calling with a url, add it as a url
>> > > parameter abcd.asp?parentPageGUID="<%!!
>> > > Context:CurrentMasterPage.Id> !!%>
>> >
>> > > If you're calling the plugin from the actions menu or someting, you're
>> > > kinda hooped.
>> > > You might be able to parse it out of one of the session variables, but
>> > > I didn't see one that had the current outer page guid.
>> >
>> > > I'd suggest creating a form, adding parentpageguid as a hidden field
>> > > along with anything else you need, setting the action of the form to
>> > > the asp file in the plugins directory, and giving the user a submit
>> > > button.
>> > > set the target to _blank and you should be good. You can get fancy
>> > > with javascript later if you want to control window size and options.
>> >
>> > > On Jul 1, 3:17 pm, Bill Rishsew <[email protected]> wrote:
>> > > > Render tags? Is there documentation for them?
>> >
>> > > > How do I insert CurrentParentPageGuid = "<%!!
>> > > Context:CurrentMasterPage.Id
>> > > > !!%>" inside of ASP code? I've tried a variety of ways to no avail.
>> >
>> > > > And Thanks.
>> > > > On Thu, Jul 1, 2010 at 1:54 PM, Wayne Bouwmeester <
>> >
>> > >  > [email protected]> wrote:
>> > > > > You should be able to get it via render tags, and render it as
>> part of
>> > > > > your code.
>> > > > > Paste this into your code (assuming the code is within the banner
>> > > > > class)
>> > > > > Otherwise, you'll need to put it in the URL you use to call your
>> > > > > plugin as a query parameter.
>> > > > > CurrentParentPageGuid = "<%!! Context:CurrentMasterPage.Id !!%>"
>> >
>> > > > > On Jul 1, 2:31 pm, Bill Rishsew <[email protected]> wrote:
>> > > > > > I used
>> >
>> > > > > > <IODATA loginguid="[!guid_login!]" sessionkey="[!key!]">
>> > > > > >   <PAGE action="load" guid="[!guid_page!]"/>
>> > > > > > </IODATA>
>> >
>> > > > > > And pulled the *parentguid*  (GUID of the element with which the
>> page
>> > > is
>> > > > > > connected.)
>> >
>> > > > > > The problem here is that it is pulling the parentguid for the
>> "main
>> > > link"
>> > > > > in
>> > > > > > the list of links!
>> >
>> > > > > > There has to be a way to get the parent link of the current
>> page!!
>> > > Right?
>> >
>> > > > > > I've been all through the RQL documentation and just don't see
>> it.
>> >
>> > > > > > On Thu, Jul 1, 2010 at 10:26 AM, Bill Rishsew <
>> > > [email protected]
>> > > > > >wrote:
>> >
>> > > > > > > Craig,
>> > > > > > >    Thanks for the input. I think I should better explain
>> myself. I
>> > > can
>> > > > > do
>> > > > > > > so now because of all of the attempts I've made at this. I'm a
>> home
>> > > > > schooled
>> > > > > > > student in RedDot and I'm the teacher too. The more I dig, the
>> more
>> > > I
>> > > > > > > understand. So I don't think
>> >
>> > ...
>> >
>> > read more ยป
>>
>> --
>>  You received this message because you are subscribed to the Google
>> Groups "RedDot CMS Users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<reddot-cms-users%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/reddot-cms-users?hl=en.
>>
>>
>
>
> --
> Work Hard! Play Harder!!
>
>


-- 
Work Hard! Play Harder!!

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/reddot-cms-users?hl=en.

Reply via email to