Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Portal current date
Previous Previous
 
Next Next
New Post 6/11/2007 3:23 AM
User is offline Daniele Bernotti
26 posts
10th Ranked


Portal current date 

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
User is offline Daniele Bernotti
26 posts
10th Ranked


Re: Portal current date 

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
User is offline Stefan Cullmann
1454 posts
6th Ranked








Re: Portal current date 

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] dotnetnuke.com

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

Need to import external data to a UDT? Try http://www.codeplex.com/Csv2UDTImport

 
New Post 6/18/2007 8:26 AM
User is offline Daniele Bernotti
26 posts
10th Ranked


Re: Portal current date 

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
User is offline iwonder
414 posts
8th Ranked


Re: Portal current date 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Portal 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.

 


Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com
Swanzey Internet Group LLC
DotNetNuke design, development, hosting, maintenance, and training. Exclusively DotNetNuke.
www.swanzey.com
Lucede Systems Group
Providing a full range of IT services for large and medium sized companies
www.lucede.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP