Nesting Apache Tiles Template - apache

So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html
Here is the example:
<definition name="myapp.homepage" template="/layouts/classic.jsp">
<put-attribute name="title" value="Tiles tutorial homepage" />
<put-attribute name="header" value="/tiles/banner.jsp" />
<put-attribute name="menu" value="/tiles/common_menu.jsp" />
<put-attribute name="body">
<definition template="/layouts/three_rows.jsp">
<put-attribute name="one" value="/tiles/headlines.jsp" />
<put-attribute name="two" value="/tiles/topics.jsp" />
<put-attribute name="one" value="/tiles/comments.jsp" />
</definition>
</put-attribute>
<put-attribute name="footer" value="/tiles/credits.jsp" />
</definition>
So I defined this:
<definition name="mgmt.base.layout" extends="base.layout">
<put-attribute name="body">
<definition template="/WEB-INF/mgmt/config/mgmtBody.jsp"/>
<put-attribute name="adminLeft" value="/WEB-INF/mgmt/config/left.jsp"/>
<put-attribute name="adminRight" value="/tiles/blank.html"/>
</definition>
</put-attribute>
</definition>
But the funny part is that, even their own documentation is wrong:
2009-05-12 11:20:56,088 [main] ERROR - org.apache.commons.digester.Digester.error(Digester.java:1635): Parse Error at line 17 column 68: Attribute "name" is required and must be specified for element type "definition". org.xml.sax.SAXParseException: Attribute "name" is required and must be specified for element type "definition".
Even though I define a name for it, it still gives the following error:
2009-05-12 11:35:31,818 [main] ERROR - org.apache.commons.digester.Digester.error(Digester.java:1635): Parse Error at line 21 column 19: The content of element type "put-attribute" must match "null".
org.xml.sax.SAXParseException: The content of element type "put-attribute" must match "null".
What is this mean?!!!!

Changing the DTD version to 2.1 solved my problem!

The schema you use requires that put-attribute is a leaf node, i.e. can't contain child elements - so you can't do that. Find out if a newer version of the schema (must be in Tiles docs or examples) allows for nested tiles templates.
-Kalle
So basically I am using a older version of tiles and using new version schema:
Here is the syntax for older nested schema:
http://tiles.apache.org/2.0/framework/tutorial/advanced/nesting-extending.html

Related

Multi-App Kiosk mode provisioning failure code '0xC00CE223'

I'm trying to put in place a kiosk on a Surface Go using the following AssignedAccess.xml file in my provisioning package:
<?xml version="1.0" encoding="utf-8" ?>
<AssignedAccessConfiguration
xmlns="https://schemas.microsoft.com/AssignedAccess/2017/config"
xmlns:r1809="https://schemas.microsoft.com/AssignedAccess/201810/config"
>
<Profiles>
<Profile Id="{f46cfb9f-044f-4d96-bb33-ea1c1c18a354}">
<AllAppsList>
<AllowedApps>
<App AppUserModelId="Microsoft.Windows.Explorer" r1809:AutoLaunch="true" />
<App AppUserModelId="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
<App DesktopAppPath="C:\Program Files\SumatraPDF\SumatraPDF.exe" />
</AllowedApps>
</AllAppsList>
<r1809:FileExplorerNamespaceRestrictions>
<r1809:AllowedNamespace Name="Downloads" />
</r1809:FileExplorerNamespaceRestrictions>
<StartLayout>
<![CDATA[<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6">
<start:Group Name="Apps">
<start:Tile Size="4x2" Column="0" Row="2" AppUserModelID="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
<start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\SumatraPDF.lnk" />
<start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
</start:Group>
</defaultlayout:StartLayout>
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
]]>
</StartLayout>
<Taskbar ShowTaskbar="false" />
</Profile>
</Profiles>
<Configs>
<Config>
<Account>CouncilKiosk</Account>
<DefaultProfile Id="{f46cfb9f-044f-4d96-bb33-ea1c1c18a354}"/>
</Config>
</Configs>
</AssignedAccessConfiguration>
I took a look at the logs and the consensus seems to be this error code '0xC00CE223'. According to my research this is telling me that "Validate failed because the document does not contain exactly one root node." (XML DOM Error Messages Doc) I'm not sure where this is going wrong.
The provisioning package is also setting 2 user accounts (local admin and local user), hiding OOBE, enabling tablet mode as default, and running a provisioning command script that installs a single application and sets registry keys necessary for autologin.
UPDATE: I re-imaged the Surface Go with Windows 10 Pro and it still fails. But now I get an error '0x8000FFFF' which appears to be related to windows update and the windows store. I only have 1 USB port on this thing so it isn't connected to the internet at this time.
UPDATE 2: I re-imaged with a more up to date ISO of 10 Pro and I'm back to the original errors listed in the above post. I have updated the XML file and changed the tag as well as the xmlns from rs5 to r1809. I am not seeing any changes and this continues to be a frustrating problem to have.
Test to change this:
https://schemas.microsoft.com/AssignedAccess/2017/config
to the following:
http://schemas.microsoft.com/AssignedAccess/2017/config

Running Gatling tests not showing testFile.log on IntelliJ

We have an issue where whenever our Gatling performance tests are run the .log file that should generate at the root of the folder is not there.
This is my whole logback file if anyone able to help please.
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter> -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
<immediateFlush>true</immediateFlush>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>testFile.log</file>
<append>false</append>
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
</appender>
<!-- uncomment and set to DEBUG to log all failing HTTP requests -->
<!-- uncomment and set to TRACE to log all HTTP requests -->
<logger name="io.gatling.http.engine.response" level="TRACE" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
Thank you very much.
Update
It seems the issue may be with IntelliJ itself as noticed we can see the file when going directly to the finder.
Disabling custom plugins should help. Seems one of configuration was corrupted.
There's a good chance the file is simply not generated where you expect it. Try setting an absolute path instead to verify.

WIX Installer: Updating existing value in config file

I am new to Wix and up till now I was able to manage it but now I want to update existing value of a Sub node from a config file. Below is my code to update it. But I get the error: failed to find the node.
<Component Id="ServiceIPAndPortSave" Guid="*" Directory="INSTALLFOLDER">
<CreateFolder/>
<util:XmlConfig
Id="UpdateIP"
On="install"
File="[INSTALLFOLDER]ProjectName.exe.config"
Action="create"
Node="value"
ElementPath="//configuration/userSettings/ProjectName.My.MySettings/setting[\[]#name='IPAddres'[\]]/#value"
Value="[SERVICEIP]"
/>
</Component>
And below is the format for my config file:
<configuration>
<userSettings>
<ProjectName.My.Settings>
<setting name="IPAddres" serializeAs="String">
<value>127.0.0.1</value>
</setting>
</ProjectName.My.Settings>
</userSettings>
</configuration>
Your XPATH expression is incorrect, you have two problems:
Your reference to the ProjectName.My.Settings element is invalid, you are using ProjectName.My.MySettings.
Your reference to the value element is invalid, you are using attribute notation.
And while not incorrect, you are rooting the search from anywhere by using // at the start of your query.
Try:
/configuration/userSettings/ProjectName.My.Settings/setting[\[]#name='IPAddres'[\]]/value

Log4net: The process cannot access the file because it is being used by another process

I have an asp.net website that is utilizing log4net. Due to several third party libraries (like NHibernate), there are several appenders across multiple threads. IIS is setup so there should be only one process. I have confirmed this by utilizing the process id in the filename.
Web.config Excerpt:
<appender name="AppAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="Logs\App_[%processid]_.log" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="yyyy-MM-dd" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="false" />
<preserveLogFileNameExtension value="true" />
<threshold value="DEBUG" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value=" %date %-5level [%property{SessionId}] - %message%newline" />
</layout>
</appender>
When recycling the app pool in IIS I sometimes get these errors:
log4net:ERROR [RollingFileAppender] ErrorCode: GenericFailure. Unable to acquire lock on file App_[6844]_2014-12-18.log. Access to the path 'App_[6844]_2014-12-18.log' is denied.
My question, is are some of these error inevitable because its multi-threaded, or if configured properly should they never occur.
Additional Info:
I'm using log4net 1.2.13 (installed over nuget)
Frozen Mountain's WebSync (3.5.1.3), also note that this library directly references log4net 1.2.11, I used a bindingRedirect to 1.2.13
NHibernate version 3.1.0.400, it was the first version to not use log4net 1.2.10
**NHibernate can easily be upgraded if we think thats the problem. WebSync would be more difficult.

Showing command on toolbar based on perspective

I want to show a command on the toolbar based on the perspective. I have used core expressions to achieve this as below.
<extension point="org.eclipse.core.expressions.definitions">
<definition id="onValidationPerspective">
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="com.sample.perspective1"/>
</with>
</definition>
</extension>
and I have used this in the command tag as below.
<command
commandId="com.sample.run.root"
icon="icons/run_exc.gif"
label="Reset Card"
style="pulldown">
<visibleWhen checkEnabled="false">
<reference
definitionId="onValidationPerspective">
</reference>
</visibleWhen>
</command>
The above code is working fine.
But I want to extend this for mutiple perspectives, i.e. I want to show the commands on the toolbar in 2 perspectives namely com.sample.perspective1 and com.sample.perspective2.
How can I achieve this using core expressions?
You can use the OR operation element:
<definition id="onValidationPerspective">
<or>
<with ...
<with ...
</or>
</definition>
<definition id="onValidationPerspective">
<with variable="activeWorkbenchWindow.activePerspective">
<or>
<equals value="com.sample.perspective1"/>
<equals value="com.sample.perspective2"/>
</or>
</with>
</definition>