Storing Non-Visible (But Required) Information in a FlowDocument - xaml

I am trying to write a two-way XHTML to FlowDocument (FD) XSLT transformation, and I'm running into a recurring issue - there are things you can do in HTML that don't make sense (at least in this early version) in a FD. For example, XHTML has the notion of an accesskey attribute, but there is no corresponding FD XAML element.
Even though the FD has no use for it, I need a way to store this information in the XAML of the FD so I can retrieve it later. Something along the lines of:
<xsl:template match=#accesskey>
<InvisibleElement name="accesskey" value="." />
</xsl:template>
...but to my knowledge, there is no FD element that doesn't have a corresponding display. I suppose I could use an empty <Span /> or <Run />, but that could lead to issues if someone edits the document and inadvertently adds content where I don't expect it.
Another option might be:
<xsl:template match="#accesskey">
<InlineUIContainer Tag="accesskey">
<TextBlock Visibility="Collapsed" Tag="{.}" />
</InlineUIContainer>
</xsl:template>
Since it wouldn't be visible, it'd be uneditable.
Suggestions?

Related

XUL textbox is not editable or visible

When using an XUL <textbox> element in the latest Firefox releases, I am not able to focus the element and write something into it. It worked in older versions, like 33. Using html:textarea instead seems to work. However, I would be happy to keep the original XUL element in my app and want to understand what is going wrong here.
When using the multiline attribute on the <textbox> element, the element is not visible at all!
Any hint or explanation would be great.
Here is my small test.xul file content:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html = "http://www.w3.org/1999/xhtml"
width="800"
height="800">
<textbox flex="1" />
<html:textarea flex="1" />
</window>
Found the problem.
I had an override rule in my chrome.manifest file which looked like this:
override chrome://global/locale/textcontext.dtd
chrome://myapp/locale/xulrunner_global_textcontext.dtd
The file was changed for firefox 38 and an additional ENTITY was added which is not defined in my file. Adding the missing ENTITY solved all problems.
Thanks Makyen for testing and inspiration.
The changes for those who are interested:
https://hg.mozilla.org/releases/l10n/mozilla-beta/de/diff/6f25b6d2dcf5/toolkit/chrome/global/textcontext.dtd

collapse bookmarks by default in dita 1.8.4

i have a working customization, but what i cannot figure out is, how to set the bookmarks in my pdf document to 'collapsed' by default.
i tried to paste
<property name="args.bookmark.style" value="COLLAPSED" />
into my build file, as well as into build.xml, build_template.xml and build.properties in the plugin and customization folder.
Nothing seems to have an effect on this.
Am i missing a step?
(I have been wondering if there was something in my customization which would automatically leave the bookmarks expanded, but I do not know where to look for this... I am pretty sure this is not the problem)
Thanks in advance!
If you look in this XSLT stylesheet:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/basic-settings.xsl
there is a parameter called "bookmarkStyle" which gets its value from the ANT build files.
<xsl:param name="bookmarkStyle">
<xsl:choose>
<xsl:when test="$antArgsBookmarkStyle!=''"><xsl:value-of select="$antArgsBookmarkStyle"/></xsl:when>
<xsl:otherwise>COLLAPSED</xsl:otherwise>
</xsl:choose>
</xsl:param>
As you can see, the default value for that parameter is COLLAPSED so you should do nothing to obtain this default behavior, I tested and the bookmarks area in a generated PDF only shows the top-level topic references.
You can also add an xsl:message in that parameter and see the value it receives from the build files.
Maybe you have another expectation of what args.bookmark.style was intended to be used for.
I finally found out what was the problem.
There was no need to change any ANT properties.
All it needs is to add the following attribute:
<xsl:attribute name="starting-state">hide</xsl:attribute>
in the template:
<xsl:template match="*[contains(#class, ' topic/topic ')]" mode="bookmark">

Is it possible to stop Icefaces from appending -dis to a disabled component's style class?

I have the following code (only relevant attributes included):
<ice:inputText styleClass="myClass" />
renders as
<input class="myClass" />
which is perfectly fine, but
<ice:inputText styleClass="myClass" disabled="true" />
renders as
<input class="myClass-dis" disabled="true" />
so the original style class is no longer applied.
Now, of course I could change my CSS to accomodate for that, but I have several different classes for differently styled input fields, which would all need to then have their own -dis version. This is especially annoying since the disabled style is the same for all of them and the normal CSS way is perfectly suited to handle this: simply combine classes to add the desired look to whatever the standard style is.
So, is there a way to stop IceFaces from automatically affixing my style classes (e.g. like prepending form-IDs can be controlled)?

Sitecore custom dialog application remains empty

So I've created a small custom dialog application for sitecore that is called through a ribbon button which triggers a command which in turn triggers my custom control.
My command (which works in triggering the open dialog trigger):
var uri = UIUtil.GetUri("control:LanguageCopyModule");
var id = context.Items[0].ID.ToString();
var la = context.Items[0].Language;
var url = string.Format("{0}&id={1}&la={2}", uri, id, la.Name);
SheerResponse.ShowModalDialog(url);
The URL it generates in a popup window:
http://mydomain/sitecore/shell/default.aspx?xmlcontrol=LanguageCopyModule&id={E67AD356-3999-4D4C-ACE4-C570EFD1FBE0}&la=en
Untill this point it all works prefectly, but now when it opens my xml control window it just stays empty.
This is the code behind the xml:
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
<LanguageCopyModule>
<FormDialog Icon="Applications/16x16/paste.png" Header="Language Copy Module" Text="Copy field values between different languages." OKButton="Copy" CancelButton="Cancel">
<CodeBeside Type="MyAssembly.Modules.LanguageCopyModule.LanguageCopyModule,MyAssembly.Modules"/>
<GridPanel Columns="2">
<GridPanel.ColumnStyles>
<Column Width="70%" />
<Column Width="30%" />
</GridPanel.ColumnStyles>
<GridPanel.RowStyles>
<Row Height="100%" />
</GridPanel.RowStyles>
<!-- Fields -->
<FlowPanel>
<Border BorderThickness="1" BorderBrush="black">
<Text>Text</Text>
</Border>
</FlowPanel>
<!-- Languages -->
<FlowPanel>
<Border BorderThickness="1" BorderBrush="black">
<Button>Button</Button>
</Border>
</FlowPanel>
</GridPanel>
</FormDialog>
</LanguageCopyModule>
</control>
Any ideas as to why it remains empty? There's little documentation to be found and it could be I just missed something.
Thanks for any assistance!
This is regulated by the <controlSources> element in web.config. You can either put your XML control to any of the folders mentioned there, or add another control source. Note that there's a special "override" folder foreseen for such purpose. If you still need to add your own control source, remember that from Sitecore 6.0 it can be done in a pluggable configs (there's official Sitecore doc on this plus several blog posts out there).
I have found the issue: the .xml file NEEDS to be somewhere under /sitecore/shell in your filesystem.

SharePoint Content Query Web Part question

I'm using CQW to display announcement list. Only problem I'm facing to provide "Add new announcement" button like the one having in Announcement list.Here is my CQW ,
I've tried adding custom "Add new Announcement" link from SharePoint designer. But this solution looks ugly. Can we provide exact button and the interface which default "Add new announcement" link provides ? Please not it's on web part page.
Here is my SPD if someone want to see,
Editing the XSLT can be your solution.
If the repeating is the only thing that stops you from modifying the XSLT, we have to solve that.
You can stop the repeating by using a check on the current position. Only add the link when the position is 1.
Define the current position and use it:
<xsl:param name="CurPos" />
<xsl:if test="$CurPos = 1">
<![CDATA[ Here your link can be placed ]]>
</xsl:if>