Custom live template does not show up in xhtml JSF file - intellij-idea

I am using IntelliJ 2017.2 ultimate edition and I have created a live template to surround text in xhtml (JSF) by a tag and attribute.
#{myvalue}
should become
<h:outputText value="#{myvalue}" />
I created a live template named "swot" applicable to in XML : XML Text.
<h:outputText value="$SELECTION$" />
Unfortunately, it does not show up when I try to surround a selection in a xhtml file. I only get standard live templates.
Update with solution
As the file in which I want to applicate the template is JSF xhtml file, I just had to applicate it to "JSP"

As the file in which I want to applicate the template is JSF xhtml file, I just had to applicate it to "JSP"

Setting the applicability to HTML should solve your issue. Please see below image:

Related

TYPO3 v10: How to remove meta tag generator?

<meta name="generator" content="TYPO3 CMS" />
I could use the Meta Tag API
$metaTagManager = GeneralUtility::makeInstance(MetaTagManagerRegistry::class)->getManagerForProperty('generator');
$metaTagManager->removeProperty('generator');
but I would need some Default Controller/Action for all Pages which I dont have.
maybe I can hook into the PageRenderer, but how can I do this?
One of the features of sourceopt extension available in official extension repository is the possibility to remove the generator meta. Just install it with Extension Manager in the backend, then enable with these lines in the Setup field of your TypoScript template probably on the root page (optionally after including extensions TS in your template go to Constants editor to click the options):
config.sourceopt.enabled = 1
config.sourceopt.removeGenerator = 1
Bonus tip: check the extension's manual for more options like removing comments or formatting/minimizing output HTML.

Can I use HTML DSL to return partial HTML documents?

I'm trying to build a REST API where I send back some resources using a single HTML element as a representation instead of a complete document. For example instead of
<html>
<body>
<table>....</table>
</body>
</html>
I just want to return the Table element and its content.
Using the HTML DSL directly with call.respondHtml I only can create complete HTML documents with all the boilerplate.
If I build an XML document by hand and try to send this back with call.respondHtml, I only get an empty HTML document.
Is there a way to do what I want with the HTML DSL in KTOR or do I have to fall back to serializing the XML document by hand? Or would be using a template engine a better way?
If you have your table built as a child template, you can return it as demonstrated below:
call.respondText(
buildString {
appendHTML().div {
insert(TableTemplate(), TemplatePlaceholder())
}
}
)
It doesn't build the whole HTML document, but you template is embedded in another div.
Related post: ktor - is there a way to serialize sub-template Template<FlowContent> to txt/html?
Ktor docs: https://github.com/Kotlin/kotlinx.html/wiki/Streaming

How to create uneditable / locked regions in templates in IntelliJ IDEA

I have created a template file in my project which I want to apply to almost all pages in my website/project.
Ideally I would like there to be editable regions and uneditable/locked regions in the template, so that when I update the code in the template it should update all the uneditable regions in the pages that use this template.
For example, in Dreamweaver, you can do this:
<!doctype html>
<html lang="en">
<head>
<title>
<!-- TemplateBeginEditable name="title" -->
<!-- TemplateEndEditable -->
</title>
<head>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
The <title> and <head> areas remain editable for any page and won't be overwritten when a template file code changes. However if I was to remove the <html> tag then that would be removed for all pages using the template.
Can I achieve this in IntelliJ IDEA at all?
In IntelliJ IDEA consider using Structural Search and Replace - to find and replace some common code pattens or code templates. See Searching for XML and HTML tags, attributes, and their values for examples.

Tagged PDF using an HTML to PDF Converter such as Winnovative

There are many converter available on the market to create and manipulate PDF file from a simple HTML/CSS page. These tools are very convenient to create quickly some nice PDF files without the hassle of the more complex reporting tools of this world.
I am using Winnovative software to achieve this goal but I was wondering how to create accessible file (tagged PDF) to improve text-to-speach tool processing.
Are there any HTML tags that exists to achieve this? Anybody has some experience with this kind of requirements?
The tool itself has to be able to support the pdf/ua spec (tagged pdf). The list of possible PDF tags corresponds nicely to html tags. For example, there are <h1> through <h6> tags, table tags (<table>, <th>, <tr>, <td>), list tags (<l>, <li>), and so on.
There are minor differences, such as the tag to start a list is <l> instead of html's <ul> or <ol>. With a PDF document, the screen reader will say "list with 3 items" and then you navigate through each item. It doesn't seem to care if it's bulleted or numbered, thus the reason pdf/ua has <l> and html has <ol> and <ul>.
Anyway, the point is you don't need to use any special html tags to generate tagged pdf. The tool that generates the pdf just needs to support pdf/ua. I didn't see anything on Winnovative's website that indicated it support it.
FYI, here are the tags available in PDF/UA
<Art>
<Annot>
<BibEntry>
<BlockQuote>
<Caption>
<Code>
<Div>
<Document>
<Figure>
<Form>
<Formula>
<H>
<H1>
<H2>
<H3>
<H4>
<H5>
<H6>
<Index>
<Lbl>
<Link>
<L>
<LI>
<Lbody>
<Note>
<P>
<Part>
<Quote>
<Reference>
<Sect>
<Span>
<Table>
<TD>
<TH>
<TOC>
<TOCI>
<TR>
Essential PDF supports generating tagged PDF when converting from HTML to PDF using the Internet Explorer MSHTML engine.
Note: I work for Syncfusion.
Good explanation in slugolicious' answer about tagging PDF. While researching accessible PDF output for a project I found PDFReactor (www.pdfreactor.com) can do this. Unfortunately there's no budget for a license in this project right now, so I haven't tested it in production, but have tried the free personal version with satisfying results.

CFDocument PDF not showing Japanese data

I have created a pdf with Japanese content using CFDocument. But It does not showing the Japanese data. I have used pageEncoding as utf-8. It showing only blank space instead of Japanese data.
I have used the following code,
<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="attachment;filename=test.pdf">
<cfprocessingdirective pageencoding="utf-8">
<cfdocument format="PDF" localurl="yes" marginTop=".25" marginLeft=".25" marginRight=".25" marginBottom=".25" pageType="custom" pageWidth="8.5" pageHeight="10.2">
<cfoutput>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PDF Export Example</title>
<style>
body { font-family: Verdana; }
</style>
</head>
<body>
<h1>PDF Export Example</h1>
<p>担当するクライエントの大半は様々な規模の企業だが、カナダの大学や政府関連の研究機関の担当経験もある。
</p>
<h1>PDF Export English Example</h1>
<p>This is an example.
</p>
</body>
</html>
</cfoutput>
</cfdocument>
Please help!
It seems Verdana's implementation when used in PDF doesn't support Chinese / Japanese. However it looks like MingLiU does. I just changed it to use that font, and everything worked OK via ColdFusion 10. It still didn't work in Railo, but I assume that's a Railo problem, not a PDF / font problem.
So, anyway, just use a font that specifically supports the glyphs you need to render.
Something I ran into years ago.
In order to have the Chinese or Japanese characters rendered up
correctly in PDF using and , you should first check what's your
default locale at ColdFusion Administrator -> Setting Summary -> Java
Default Locale. One would have thought CFML will respect custom
locale using setLocale(), but it doesn't.
If it is "en_US", edit /lib/cffont.properties. Otherwise, create a
/lib/cffont.properties.#locale#(e.g. /lib/cffont.properties.zh_TW )
using cffont.properties as reference.
Replace the font(s) after '=' with system's Chinese font (e.g.
MingLiu) for Chinese or system's Japanese font (e.g. MS UI Gothic) for
Japanese respectively, assuming ColdFusion is installed on Windows,
and client has the respective font(s) installed.
http://henrylearnstorock.blogspot.ca/2010/08/how-to-render-chinese-japanese.html