Something to dynamically Generate a UI to edit XML file? - asp.net-mvc

I have an XML file with a lot of nodes similar to the following format:
<Factsheet page="GenericOfflineFactsheet.aspx" pageTitle="MyTitle" >
<TopStrapline text="BlahBlahBlah" />
<Commentary page="Text.ascx" />
<ChartPanel page="Bar.ascx" appearanceFile="Bar.xml" />
<Strapline text="blah blah blah" />
<Funds>
<fund id="215" countryid="N0" />
<fund id="561" countryid="N0" />
</Funds>
<LegalText effectiveDate="08 June 2010">
<Line id="30321" />
<Line id="10301" />
</LegalText>
</Factsheet>
Is there any free plugins (or any other means) out there that I could use in an ASP.NET MVC application to generate a basic UI for editing this kind of file?

What about LinqToXML? Then you can use this as your model in your controllers and views just like LinqToSQL.
LinqToXML

Related

Using MvcSiteMapProvider with exising StaticSiteMapProvider class

I'm converting as webforms app to MVC. The previous programmer built a class that inherits the StaticSiteMapProvider class to create his sitemap. He then placed this control on the page
<asp:SiteMapDataSource ID="sitemapSQLMenuProvider" runat="server" ShowStartingNode="False" />
and initialized it like this
Dim oSqlSiteMapProvider As New SQL.SiteMap.Provider.SQLSiteMapProvider(Session("KPISystemUserID"), PagePath)
oSqlSiteMapProvider.Initialize("MySiteMap", Nothing)
SiteMapDataSource1.Provider = oSqlSiteMapProvider.
He then used the menu control and specified the data source
<asp:Menu ID="menuMaster" runat="server" DataSourceID="sitemapSQLMenuProvider"/>
I created a class in my MVC project and copied the code over to create the SQLSiteMapProvider class. It created nodes... subnodes.. etc. Is there an easy way with the MvcSiteMapProvider package from Nuget to simply specify this class as where to get the Nodes from? All the documentation just keeps trying to get you to use a static XML file (which i can't use because our menus come from the DB).
It looks like the webform programmer set up his provider like this in the web.config
<siteMap defaultProvider="KPIMap" enabled="false">
<providers>
<clear />
<add name="KPIMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/System/MY.sitemap" />
</providers>
</siteMap>
and that xml file was simply
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="">
<siteMapNode url="" title="" description="" />
<siteMapNode url="" title="" description="" />
</siteMapNode>
</siteMap>
You'd think they would have added a simple way to plug in the name of a StaticSiteMapProvider class and be done with it.

Cordova Tools for VS 2005: iOS app does not display splashscreen and icons

Using VS 2013 Cordova Tools (the current version), my iOS app does not display the given splashscreen and icons unless I set <icon> and <splashscreen> elements in config.xml. However, when config.xml is edited using the visual editor, it simply deletes all <icon> and <splashscreen> elements. Am I missing something?
Obs: icons and splash screen works for android apps out of the box, it just does not work for iOS.
Unfortunately this is a known issue when using the latest version of vs-mda-remote with VS 2013.
You should be able to add this XML to config.xml via Right-Click > View Code to resolve the issue.
<platformname="ios">
<iconsrc="res/icons/ios/icon-60-3x.png"width="180"height="180" />
<iconsrc="res/icons/ios/icon-60.png"width="60"height="60" />
<iconsrc="res/icons/ios/icon-60-2x.png"width="120"height="120" />
<iconsrc="res/icons/ios/icon-76.png"width="76"height="76" />
<iconsrc="res/icons/ios/icon-76-2x.png"width="152"height="152" />
<iconsrc="res/icons/ios/icon-40.png"width="40"height="40" />
<iconsrc="res/icons/ios/icon-40-2x.png"width="80"height="80" />
<iconsrc="res/icons/ios/icon-57.png"width="57"height="57" />
<iconsrc="res/icons/ios/icon-57-2x.png"width="114"height="114" />
<iconsrc="res/icons/ios/icon-72.png"width="72"height="72" />
<iconsrc="res/icons/ios/icon-72-2x.png"width="144"height="144" />
<iconsrc="res/icons/ios/icon-small.png"width="29"height="29" />
<iconsrc="res/icons/ios/icon-small-2x.png"width="58"height="58" />
<iconsrc="res/icons/ios/icon-50.png"width="50"height="50" />
<iconsrc="res/icons/ios/icon-50-2x.png"width="100"height="100" />
</platform>
<platformname="ios">
<splashsrc="res/screens/ios/screen-iphone-portrait.png"width="320"height="480" />
<splashsrc="res/screens/ios/screen-iphone-portrait-2x.png"width="640"height="960" />
<splashsrc="res/screens/ios/screen-ipad-portrait.png"width="768"height="1024" />
<splashsrc="res/screens/ios/screen-ipad-portrait-2x.png"width="1536"height="2048" />
<splashsrc="res/screens/ios/screen-ipad-landscape.png"width="1024"height="768" />
<splashsrc="res/screens/ios/screen-ipad-landscape-2x.png"width="2048"height="1536" />
<splashsrc="res/screens/ios/screen-iphone-568h-2x.png"width="640"height="1136" />
<splashsrc="res/screens/ios/screen-iphone-portrait-667h.png"width="750"height="1334" />
<splashsrc="res/screens/ios/screen-iphone-portrait-736h.png"width="1242"height="2208" />
<splashsrc="res/screens/ios/screen-iphone-landscape-736h.png"width="2208"height="1242" />
</platform>
More known issues: https://www.visualstudio.com/explore/cordova-known-issues-vs
I had similar problem. I simply didn't use graphical config editor and use only text one.
However, the Visual Studio 2015 RC fixes this problem and there is an implicit configuration for every icon and splash screen.

Export a nested displaytag table in excel

I have displayed a nested table using display tag .
The code of my nested table is:
<display:table export="true" name="detailsList" id="parent" requestURI="" pagesize="1">
<display:column property="testcaseName" />
<display:column property="subject" />
<display:column property="description" title="Comments" />
<c:set var="nestedName"
value="detailsList[${parent_rowNum -1}].testList" />
<display:column title="TestCase Details" >
<display:table name="${nestedName}" id="child${parent_rowNum}"
class="SimpleSublist">
<display:column property="stepName" />
<display:column property="description" />
<display:column property="inputField" />
<display:column property="inputData" />
<display:column property="expectedResult" />
<display:column property="remarks" />
</display:table>
</display:column>
</display:table>
I wanted to have the export option for the same...
But I am not able to figure out how to do it..
Is there any workaround as the inbuilt export does not work here..
Which in-built export are you talking about? If you want to export something to excel, you will have to do it programatically using libs like apache poi [I have used it and found it great] and its examples.
UPDATE:
I googled and found this display tag link which says that nested tables cannot be exported by display tag :( (check the last line of limitations)
So the solution suggested above will work for you..

Log4Net only logging when browsing from localhost

I've used Log4Net in multiple applications for a while. It has been working fine, but recently I noticed that the applications were suddenly not logging anymore. Turns out this issue is the same for all my applications, and they all suddenly stopped logging some months ago. The strange thing is that the logging works when I access the applications directly on the server (http://localhost/myApp), while nothing is logged when I access the application from another PC. My first thought was that it must be related to file/folder permissions, but allowing "Everyone" (Windows user group) full access to the log folder did not help.
They are all ASP.Net MVC 4 applications running on IIS7 (Windows 2008 R2 Enterprise OS), and the application pool is using "ApplicationPoolIdentity". Log4Net version is 1.2.10.0 and I am using a custom CompositeRollingFileAppender. I thought it may have been something wrong with the custom appender, but the problem remained the same when I tried switching to the standard RollingFileAppender. I've seen the issue on multiple servers.
Has anyone seen something similar? Please share your thoughts, as I cannot see why there should be any difference in accessing the applications locally or remotly.
Here is the log4net section in one of my applications' web.config:
<log4net>
<appender name="RollingFileAppender" type="[mynamespace].CompositeRollingFileAppender">
<file value="Logs/ApplicationLog.log" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<maxSizeRollBackups value="20" />
<maximumFileSize value="10MB" />
<datePattern value="_yyyy-MM-dd" />
<staticLogFileName value="true" />
<preserveLogFileNameExtension value="true" />
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%utcdate;%property{ErrorCode};%property{Severity};%property{ErrorName};%property{Module};%m%n" />
</layout>
</appender>
<root>
<priority value="ALL" />
<appender-ref ref="RollingFileAppender" />
<level value="Warn" />
</root>
<logger name="NHibernate">
<level value="OFF" />
</logger>
<logger name="NHibernate.SQL">
<level value="OFF" />
</logger>
</log4net>
Turns out the issue was not directly related to log4net, but to the way ASP.Net MVC3 and newer handles exceptions by default. Some months ago we updated our applications from MVC2 to MVC4, and because of this code which is executed by default from global.asax.cs.Application_Start(), it "bypassed" our exception handling module when CustomErrors where set to RemoteOnly or On:
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
This thread put me on the right track. I ended up removing the filters.Add(..) line, and now it seems to be working fine!

How to use encrypted configuration data in Grails application?

I am working on a Grails based application.
I have configured my application to work with mail and Database setting from
configuration file(app-config.properties file present in the conf folder).
It is working properly.
Config.groovy:
grails<br />
{<br />
mail<br />
{<br />
host = ""<br />
username = ""<br />
password = ""<br />
port = 0<br />
from = "" <br />
props = ["mail.smtp.auth":"true" ]<br />
}<br />
}<br />
**app-config.properties**:<br />
grails.mail.default.from =abc#test.com<br />
grails.mail.host =mail.test.com<br />
grails.mail.username =testUser<br />
grails.mail.password =testPassword<br />
grails.mail.port =25<br />
grails.mail.from = abc#test.com<br />
Some Other Details:
1. Grails Version : 1.3.7
2. Mail Plugin version : 1.0
My requirement is that I want to use encrypted user name and password for mail setting.
My question is that how can I use any encrypted property with mail setting as well as any
other attributes in Grails(i.e. Database user credentials....).
Regards,
Sanjay Kharwar
Already somewhat answered in the 2 following places:
Stackoverflow answer
Grails-3620
I ran across this site while searching: http://grsage.com/new/GrailsPasswordEncyrption.html
It's pretty straight foward.

Resources