HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsXMLXMLPortal current datePortal current date
Previous
 
Next
New Post
6/11/2007 3:23 AM
 

Hi

I'm using xml/xsl module to display corporate announcements. I've a XML file that stores metadata of what I've to display.

One of the metadata is the publishing date and the expiration date. There is no way to pass the browser/portal current date to the xsl like parameter to have this value in the xsl to filter data?

I see that XML and XSL parameters are varous, but no date it's available.

At the minute I use a javascript to create a remporary XML and create in a HTML module the transformation, but... this fails in browsers that are no IE and expecially on Mac this doesn't work.

Thanks in advance

Regards

Daniele

 
New Post
6/13/2007 9:46 AM
 

Just to clarify my request. XSLT has no functionality to retrieve the current date. there is a way to have this field available? I've tried to add a parameter with this value, but "static value" doesn't works.

any idea where locate something like "Date()" that retrieve current date?

Thanks

Daniele

 
New Post
6/13/2007 10:21 AM
 

Yes, you will need to alter the xml module.

You would need to add the needed code to the following files:
~app_code\xml\parameters\parametertype   ->add a new CurrentDate to the Enum
~app_code\xml\parameters\parameterinfo   ->alter Getvalue to support ParameterType.CurrentDate
~DesktopModules\XML\Parameters\ParameterEditor.ascx -> add a new listitem to cboparamType, please add it as last item

That is the idea. I will add tis enhancement to the next release.


Stefan Cullmann
stefan.cullmann [at] gmail.com
http://www.formandlist.com
 
New Post
6/18/2007 8:26 AM
 

Hi Stefan

I got a my colleague that made the mod for me. I had this issue that I think need to be considered for your futute XML/XSL release: the format used to display the date is strictly related with browser language selected.

IIn other words the initial mod based on the VB code:
                Case ParameterType.CurrentDate ' Custom CurrentDate
                    Return Date.Now.ToShortDateString()

gave a non consistent date format result. XSLT 1.0 has no functions to handle correctly dates, so I rebuild dates using format like substring-after(substring-before(xxx,'/'), '/')... and this is the format date is not consistent "dd/mm/yyyy" or "dd-mm-yyyy" or worst "mm-dd-yyyy" generate a huge complication to write and andle XSL.

 

I've asked myt colleague of something more consistent and what I've now:
                Case ParameterType.CurrentDate ' Custom CurrentDate
                    Return Date.Now.ToString("yyyy-MM-dd")

give a consistent result and I can handle date better than before.

I hope this "live" experience may help.

Regards

Daniele

 
New Post
8/8/2007 1:25 PM
 

Just wanted to add a bit to this discussion...

I was previously using an embedded script inside my xsl to accomplish this type of usage, but as Stephan pointed out, using embedded scripts incurs a heavy performance load, as well as opens up some security issues.  So, support of xsl scripting was removed from the latest release. 

So, I made the changes as previously mentioned, but with a slight difference which gives me the ability to use the module in the manner we need. The post title indicated that this would provide PortalDate info, but actually, the method illustrated is pulling the date info from the Server point of view.  So, I made my mods as follows:

        Case ParameterType.ServerDate ' Custom CurrentDate
                        Return Date.Now.ToString("yyyyMMdd")

        Case ParameterType.ServerDateTime ' Custom CurrentDate
                        Return Date.Now.ToString("yyyyMMddHHmmss")

You can see I named the options ServerDate, and ServerDateTime.  We did it in this manner to support using a custom xml file that contains button links that have a pubDate and ExpireDate.  With these 2 options, we can use XML/XSL to dynamically display the button links for the desired period of time.  It's an older method of providing user site navigation, but it was needed to support the client's need.

If the module is updated to include this kind of support for DateTime, it's important to implement it with the correct point of view, which means that support is needed to display the Server date time info, and the Portal date time info.  At least, that's what I'm doing, and I would like to see it incorporated in future releases, just to save me from making the mods myself, but now that we have the knowledge to do it, it's not that big a deal, but would be appreciated.

Thanks for sharing the info...

 
Previous
 
Next
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsXMLXMLPortal current datePortal current date


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
DotNetNuke Store

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

r2integrated
Telerik JustCode Free
DotNetNuke DNN Hosting

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.