CSS3 paged media mode: Any way to prevent #top_right pdfreactor logo being inserted? - css-paged-media

With any attempt to use paged media mode, with for example a style sheet containing :
<html><header>...<style type="text/css"> ...
body { counter-reset: chapter 1;
counter-reset: section 1;
counter-reset: page 1;
margin-left: +2%;
margin-right: -2%;
font-size: 10pt;
}
#page { size : a4 ;
margin: 8%;
#top-left { content: "abbrv"; ; font-size: 8pt;}
#top-center { content: "Chapter " counter(chapter) " : " counter(section); font-size: 8pt;}
#top-right { content: "$date : $initials"; ; font-size: 8pt; }
#bottom-center { content: "Page " counter(page) " / " counter(pages); font-size: 8pt; }
}
div.chapter {
break-before : always;
counter-increment: chapter;
counter-reset: section;
}
section.section {
counter-increment: section;
}
</style></header><body>
<div id="chap1" class="chapter"><h1>Chapter 1</h1></div>
...</body></html>
Note the above does not contain ANY reference to embedded images, but when run through PDFreactor the resulting PDF
contains a small round radio-active graphic with the word "PDF" overlaid on top , in the #top-right content, after my
"$date : $initials" content.
I think this is "pdfreactor.svg" ?
So is it not possible to remove the logo ?
Moving all files named pdfreactor.svg under the PDFreactor/
installation directory to other locations did not help.
I am using the free-for-personal-non-commercial license which
I obtained by email from Real Objects ,NOT the evaluation license .
Are personal non-commercial users not allowed to
disable the inclusion of this logo in the page header block ?
Has anyone succeeded in disabling the inclusion of the logo image - if so, how ?
Also, does anyone know why the chapter & section counters are always displayed as 0 in the page header of the above document?
The Java I am using is:
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.realobjects.pdfreactor.Configuration;
import com.realobjects.pdfreactor.PDFreactor;
import com.realobjects.pdfreactor.Result;
import com.realobjects.pdfreactor.Log;
import com.realobjects.pdfreactor.Record;
import com.realobjects.pdfreactor.events.DefaultHandler;
class PDFReactor
{
public static void main( String args[] )
{ File html_in = null , pdf_outf=null;
String html_in_url = null;
FileOutputStream pdf_out=null;
boolean expect_in=false , expect_out=false;
Logger logger = null;
try {
logger = Logger.getAnonymousLogger();
logger.setUseParentHandlers(false);
logger.setLevel(Level.INFO);
logger.addHandler(new DefaultHandler());
}catch(Exception e)
{ System.err.println("Failed to get logger: " + e.toString());
}
for ( String arg : args )
{ switch(arg)
{ case "-f" :
expect_in=true;
break;
case "-o" :
expect_out=true;
break;
default:
if(expect_in)
{ expect_in = false;
try {
html_in = new File( arg );
html_in_url = html_in.toURI().toURL().toString();
} catch (Exception e)
{ System.err.println("new File ( " + html_in + ") failed : "+e.toString());
}
}else
if(expect_out)
{ expect_out = false;
try {
pdf_outf = new File( arg );
pdf_out = new FileOutputStream( pdf_outf );
} catch (Exception e)
{ System.err.println("new File ( " + pdf_out + ") failed : "+e.toString());
}
}
}
}
if( (html_in != null) && (pdf_out != null) && (logger != null))
{
try
{ PDFreactor r = new PDFreactor();
if( r != null )
{ Configuration configuration = new Configuration();
configuration.setLicenseKey(
my_license_key_xml
);
configuration.setDocument(html_in_url);
configuration.setLogger(logger);
List<Configuration.ViewerPreferences> prefls = configuration.getViewerPreferences();
int n=prefls.size() + 1, i=0;
Configuration.ViewerPreferences[] prefs = new Configuration.ViewerPreferences[ n ];
for( Configuration.ViewerPreferences p : prefls )
{ prefs[i] = p;
i+=1;
}
prefs[i]= Configuration.ViewerPreferences.PAGE_MODE_USE_OUTLINES;
configuration.setViewerPreferences( prefs );
configuration.setAddLinks(true);
configuration.setAddBookmarks(true);
Result result = r.convert(configuration, pdf_out);
pdf_out.close();
if( result != null )
{ Log l = result.getLog();
if( l != null)
{ for( Record rec : l.getRecords() )
System.err.println(rec.getMessage());
}else
{ System.out.println("No log records produced.");
}
}
}else
{ System.err.println("new PDFreactor failed.");
}
}catch( Exception e)
{ System.err.println("PDFreactor conversion failed: "+e.toString());
}
}else
{ System.err.println("Expected -f <html input file name> -o <pdf output file name> arguments.");
}
}
}

All PDFs created with PDFreactor using a "Free Personal License" contain this PDFreactor logo. This is intended and referred to as "notices that identify PDFreactor" in the PDFreactor software license agreement which you accepted when requesting a "Free Personal License" key and by using the software. According to the agreement these notices (such as the logo) must not be removed or tampered with in any way. Should you require PDFs without any notices you have to buy and use a commercial license of PDFreactor.
Regarding the counter issues: You are defining the counters in the wrong scope. To use them in page margin boxes, you have to initialize the counters in the "#page" rule and not in the "body" element like this:
#page:first {
counter-reset: chapter 0 section 0;
}
Also, multiple "counter-reset" properties override previous ones, so only use one "counter-reset" property for multiple counters as shown above.

Related

Using "shared logic" across multiple Typewriter templates?

We have multiple Typewriter .tst templates in our project, and would like to share some common logic/methods between them. Is there a way to do this?
You can use T4 templates to generate the Typewriter templates. Put the code inside a reusable T4 template (*.ttinclude) and create tt-files to pass parameters to the rendering method of this base template.
(I use a Visual Studio extension for File nesting.)
Each tt-file looks something like this;
<## template debug="true" hostSpecific="true" #>
<## output extension=".tst" #>
<## include file="..\ModelsTemplate.ttinclude" #>
<# this.ModelsTemplate_Render("UserSettings"); #>
...and my ttinclude file looks like this (it is a bit project specific, but I included it all so that anyone who wants to try it out can easily get something working);
<## IntelliSenseLanguage processor="tangibleT4Editor" language="C#" #>
<#+
void ModelsTemplate_Render(string #subnamespace) {
ModelsTemplate_Render("MyApp.ViewData", #subnamespace);
}
void ModelsTemplate_Render(string #mainnamespace, string #subnamespace) {
string renderedMainNamespace = #mainnamespace;
#>
// <auto-generated>
// This code was generated by a tool.
// Template: <#= Host.TemplateFile #>
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
${
// Enable extension methods by adding using Typewriter.Extensions.*
using Typewriter.Extensions.Types;
using System.Text.RegularExpressions;
Template(Settings settings)
{
settings.IncludeProject("MyApp.ViewData");
}
static string DebugInfo = "";
string PrintDebugInfo(File f){
if (string.IsNullOrEmpty(DebugInfo)) {
return "";
}
return "/*" + Environment.NewLine + "Template debug info: " + DebugInfo + Environment.NewLine + "*/";
}
string BaseClassFullPath(Class baseClass)
{
//DebugInfo = DebugInfo + Environment.NewLine + "baseClass.FullName:" + baseClass.FullName;
var result = baseClass.Name;
// Until we find a better way to handle implementations of generic base classes...
result = result.Replace("<bool?>", "<boolean>");
result = result.Replace("<int?>", "<number>");
result = result.Replace("<long?>", "<number>");
result = result.Replace("<decimal?>", "<number>");
result = result.Replace("<double?>", "<number>");
result = result.Replace("<System.Double>", "<number>");
result = result.Replace("<System.Double?>", "<number>");
result = result.Replace("<System.DateTime?>", "<Date>");
return result;
}
string NullableFilter(string typeName)
{
return typeName.Replace("?", "");
}
string TypeFilteredPath(Type type)
{
//DebugInfo = DebugInfo + Environment.NewLine + "type:" + type.FullName + " - genericType:" + type.Unwrap().FullName;
return NullableFilter(type.Name);
}
string TypeFiltered(Type type)
{
if (type.IsEnumerable)
{
var genericType = type.Unwrap();
if (!genericType.FullName.StartsWith("System"))
{
return TypeFilteredPath(genericType)+"[]";
}
}
return TypeFilteredPath(type);
}
string PropertyTypeFiltered(Property prop)
{
return TypeFiltered(prop.Type);
}
string ImplementedInterfaces(Class c){
if (!c.Interfaces.Any()){
return string.Empty;
}
return "implements " + string.Join(", ", c.Interfaces.Select(x => x.FullName));
}
string ExtendedInterfaces(Interface i){
if (!i.Interfaces.Any()){
return string.Empty;
}
return "extends " + string.Join(", ", i.Interfaces.Select(x => x.FullName));
}
string DescriptionAttributeValue(Attribute a){
if (!a.FullName.Contains("DescriptionAttribute")){
return string.Empty;
}
return a.Value;
}
string GetPropertyDefinitionWithScope(Property p){
var definition = GetPropertyDefinition(p);
if (definition != "")
return "public " + definition;
else
return definition;
}
string GetPropertyDefinition(Property p){
var ignoreAttribute = p.Attributes.SingleOrDefault(x => x.FullName.Contains("TypeScriptIgnoreMemberAttribute"));
if (ignoreAttribute != null)
return "";
var typeAttribute = p.Attributes.SingleOrDefault(x => x.FullName.Contains("TypeScriptTypeAttribute"));
if (typeAttribute != null) {
return p.name + ": " + typeAttribute.Value + ";";
}
return p.name + ": " + TypeFiltered(p.Type) + ";";
}
string WriteImports(Class theClass){
//return "import { ViewDataEntity } from '../common/ViewDataEntity';";
var list = new List<string>();
var typesToImport = theClass.Properties.Select(x => x.Type.Unwrap()).Where(x => x.Namespace.Contains("MyApp.ViewData.")).ToList();
if (theClass.BaseClass?.Namespace.Contains("MyApp.ViewData.") == true)
typesToImport.Add(theClass.BaseClass);
foreach (var impType in typesToImport)
{
var modules = impType.Namespace.Replace("MyApp.ViewData.", "").Split('.').ToList();
string modPart = string.Join("/", modules.Select(x => CamelCase(x)));
list.Add($"import {{ {impType.Name} }} from '../{modPart}/{impType.Name}';");
}
return string.Join(Environment.NewLine, list.Distinct());
}
string CamelCase(string value){
return value.First().ToString().ToLower() + value.Substring(1);
}
}//namespace <#= renderedMainNamespace #>.<#= #subnamespace #> {
$Classes(c => c.Namespace.StartsWith("<#= #mainnamespace #>.<#= #subnamespace #>"))[
$WriteImports
export class $Name$TypeParameters $BaseClass[extends $BaseClassFullPath ] $ImplementedInterfaces {$Properties[
$GetPropertyDefinitionWithScope]
}]
$Interfaces(<#= #mainnamespace #>.<#= #subnamespace #>.*)[
export interface $Name $ExtendedInterfaces {
$Properties[
$GetPropertyDefinition]
}]
$Enums(<#= #mainnamespace #>.<#= #subnamespace #>.*)[
export class $Name {
$Values[// $Value - "$Attributes[$Value]"
static $Name = "$Name";
]
}]
$PrintDebugInfo
//}<#+
}
#>
Unfortunately there's no way to share code in tst templates. Support for this will probably come in a future version though.

Set field Accessibility to Custom Salesforce Lead field from Java code

I am working around with Salesforce and force.com API and metadata API, version 36.
I can create a custom field in a Lead object but by default I can see it's hidden and this means I cannot create a new Lead with these custom fields because it returns a bad request (400 status code).
Is there any way by Code to set the custom field Visible?
public boolean createCustomExtTextField(String name, LoginResult metadataLoginResult, int length) {
boolean success = false;
CustomField cs = new CustomField();
cs.setFullName("Lead."+name+"__c");
cs.setLabel("Custom"+name+"Field");
cs.setType(FieldType.LongTextArea);
cs.setLength(length);
cs.setVisibleLines(50); // max 50
try {
MetadataConnection metadataConnection = createMetadataConnection(metadataLoginResult);
SaveResult[] results = metadataConnection.createMetadata(new Metadata[] { cs });
for (SaveResult r : results) {
if (r.isSuccess()) {
success = true;
} else {
System.out.println("Errors were encountered while creating " + r.getFullName());
for (com.sforce.soap.metadata.Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
System.out.println("Status code: " + e.getStatusCode());
}
}
}
} catch (ConnectionException e) {
e.printStackTrace();
}
return success;
}
I am googling a lot and don't find something that actually helped. So, any hints are welcomed. Thank you.
Finally found a solution to this. I final one for me was to make all custom fields REQUIRED.
CustomField cs = new CustomField();
cs.setFullName("Lead.YourCompanyName" + name + "__c");
cs.setLabel("YourCompanyName" + name);
cs.setRequired(true);
...
com.sforce.soap.enterprise.LoginResult metadataLoginResult = operations.loginToMetadata(username, password, "https://login.salesforce.com/services/Soap/c/36.0");
...
private boolean createFieldInMetadata(LoginResult metadataLoginResult, CustomField cs) {
boolean success = false;
try {
MetadataConnection metadataConnection = createMetadataConnection(metadataLoginResult);
SaveResult[] results = metadataConnection.createMetadata(new Metadata[] { cs });
for (SaveResult r : results) {
if (r.isSuccess()) {
success = true;
} else {
System.out.println("Errors were encountered while creating " + r.getFullName());
for (com.sforce.soap.metadata.Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
System.out.println("Status code: " + e.getStatusCode());
}
}
}
} catch (Exception e) {
}
return success;
}
And so it will appear in the page layout. Very important to know, a required field cannot have just an empty value set, it must be something. So if not all custom fields are required in your logic and you wanna avoid the entire process of unzipping page layout and zipping it back (however it may be done) just add "N/A" or any char at choice to the required by code but not your project custom fields.
I managed to make the custom Field Level Security visible for "Admin" profile but not Field Accessability to visible. The latter is untested.

linkedin Import Resume is not working ( keeps Loading )

I do have website of cakephp framwork & integrated with linkedin api. website do have import resume functionality and stores user details(imported from linkedin) in edit profile page.
I have indexController and its action is something like this:-
public function linkedinlogin()
{
if (isset($_GET['oauth_problem']))
{
if (isset($_SESSION['requestToken']))
{
unset($_SESSION['requestToken']);
}
if (isset($_SESSION['oauth_verifier']))
{
unset($_SESSION['oauth_verifier']);
}
if (isset($_SESSION['oauth_access_token']))
{
unset($_SESSION['oauth_access_token']);
}
$this->redirect("registration");
exit;
}
//$this->autoRender = false;
if (session_status() == PHP_SESSION_NONE)
{
session_start();
}
$this->set('PageHeading', __('Linkedin Login'));
$config['base_url'] = 'http://upitchnew.inheritxserver.net/index/registration';
if (isset($_SESSION['user_id']))
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_SESSION['user_id'] . '&tc_id1=' . $_SESSION['user_ids'];
}
else
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_REQUEST['tc_id'] . '&tc_id1=' . $_REQUEST['tc_id1'];
}
$config['linkedin_access'] = 'linkedin_access';//LinkdingAccess key
$config['linkedin_secret'] = 'linkedin_secret';//Linkdin Scret key
//=require('../Vendor/linkedin/OAuth.php');
require('../Vendor/linkedin/linkedin.php');
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
if (isset($_REQUEST['oauth_verifier']))
{
$_SESSION['oauth_verifier'] = $_REQUEST['oauth_verifier'];
if (isset($_SESSION['requestToken']))
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
}
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->getAccessToken($_REQUEST['oauth_verifier']);
$_SESSION['oauth_access_token'] = serialize($linkedin->access_token);
$this->redirect($config['callback_url']);
//header("Location: " . $config['callback_url']);
exit();
}
else
{
if (isset($_SESSION['requestToken']) && $_SESSION['requestToken'] != '')
{
if (isset($_SESSION['oauth_access_token']) && $_SESSION['oauth_access_token'] != '')
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->access_token = unserialize($_SESSION['oauth_access_token']);
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
// echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
//echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
}
This action has called once you click on import resume button, Instead of loading login with linkedin page, a page keeps loading and do not redirect to (linkedin)login page.
generateAuthorizeUrl() has called meanwhile:-
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
generateAuthorizeUrl function is something like this:-
function generateAuthorizeUrl()
{
if (isset($_SESSION['user_id']))
{
$this->user_id = $_SESSION['user_id'];
}
if (isset($_SESSION['user_ids']))
{
$this->user_ids = $_SESSION['user_ids'];
}
$consumer = $this->consumer;
$request_token = $this->request_token;
return $this->authorize_path . "?oauth_token=" . $request_token->key . "&tc_id=" . $this->user_id . "&tc_id1=" . $this->user_ids;
}
Any help would be appreciated.
Man!! sucks! It was firewall issue linkedin is using https://api.linkedin.com/uas/oauth/authorize?oauth_token=auth_token url while processing with importing user details! and that url was blocked via Sophos securities.
So it neither showing any error or anything else just keeps loading..
Issue Resolved.

Why Typo3 website special characters are not saving to database?

I got a website to move to our server and I have successfully moved it.But I have noticed some strange thing.Site doesn't render Danish characters (only special characters).When when I try to save using htmlarea in admin section and I can save Lorem Ipsum with any issue.But special danish characters are seems saving to database but when I open htmlarea it shows nothing.
Seems me there should be some configuration or settings to do.I tried to change character set but didnt work.Then whole db and table change to Utf8.No luck.
Anyone is having an idea to fix this?
please mentioned the place and page name as I am totally newbie to typo3
Thanks
More info regarding typo3 ond utf8 you can find there - http://wiki.typo3.org/UTF-8_support (TYPO3 UTF-8 support). Which TYPO3 version you have?
I think you have to modify your page typoscript configuration.
set htmlSpecialChars = 0 at the time of both entryHTMLparser_db and exitHTMLparser_db.
Use below page typoscript configuration. Might be your problem will be solved.
mod.SHARED {
defaultLanguageFlag = de
defaultLanguageLabel = Deutsch
}
# Classes. Do not forget to define them in the CSS class
RTE.classes {
# lists
checklist {
name = Checkliste
}
# tables
table {
name = Normale Tabelle
}
table-condensed {
name = Verkürzte Tabelle
}
table-bordered {
name = Tabelle mit Rahmen
}
table-styled {
name = Tabelle mit anderem Design
}
table-striped {
name = Tabelle mit Streifen
}
table-hover {
name = Tabelle mit Hover-Effekt
}
# aligns
align-justify {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyfull
}
align-left {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyleft
value = text-align: left;
}
align-center {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifycenter
value = text-align: center;
}
align-right {
name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyright
value = text-align: right;
}
csc-frame-frame1 {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame1
value = background-color: #EDEBF1; border: 1px solid #333333;
}
csc-frame-frame2 {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame2
value = background-color: #F5FFAA; border: 1px solid #333333;
}
important {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:important
value = color: #8A0020;
}
name-of-person {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:name-of-person
value = color: #10007B;
}
detail {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:detail
value = color: #186900;
}
component-items {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
value = color: #186900;
}
action-items {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
value = color: #8A0020;
}
component-items-ordered {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
value = color: #186900;
}
action-items-ordered {
name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
value = color: #8A0020;
}
style1 {
name = Stil 1
}
htmlCode {
name = HTML Code
}
phpCode {
name = PHP Code
}
}
RTE.classesAnchor {
externalLink {
class = external-link
type = url
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_titleText
}
externalLinkInNewWindow {
class = external-link-new-window
type = url
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_titleText
}
internalLink {
class = internal-link
type = page
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_titleText
}
internalLinkInNewWindow {
class = internal-link-new-window
type = page
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_titleText
}
download {
class = download
type = file
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_titleText
}
mail {
class = mail
type = mail
titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_titleText
}
more-link {
class = more-link
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
}
button-link {
class = btn
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
}
next-link {
class = ym-button ym-next
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_altText
}
back-link {
class = back-link
type = page
titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_titleText
altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_altText
}
}
RTE.default {
showButtons = *
## Enable the image button
showButtons := addToList(image)
defaultContentLanguage = de
// Make possible to read classes from the contentCSS CSS file
buttons.textstyle.tags.span.allowedClasses >
buttons.textstyle.tags.REInlineTags >
buttons.textstyle.REInlineTags >
buttons.blockstyle.tags.table.allowedClasses >
buttons.blockstyle.tags.p.allowedClasses >
buttons.blockstyle.tags.div.allowedClasses = align-left, align-center, align-right
buttons.blockstyle.tags.div.allowedClasses := addToList(csc-frame-frame1, csc-frame-frame2)
buttons.blockstyle.tags.table.allowedClasses = csc-frame-frame1, csc-frame-frame2
buttons.blockstyle.tags.td.allowedClasses = align-left, align-center, align-right
buttons.textstyle.tags.span.allowedClasses = important, name-of-person, detail
contentCSS = typo3conf/ext/fluxtemplate/Resources/Public/CSS/rte.css
buttons.formatblock.prefixLabelWithTag = 1
buttons.link.relAttribute.enabled = 1
buttons.link.queryParametersSelector.enabled = 1
buttons.link.properties.class.allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
buttons.link.page.properties.class.default = internal-link
buttons.link.url.properties.class.default = external-link-new-window
buttons.link.file.properties.class.default = download
buttons.link.mail.properties.class.default = mail
buttons.image.properties.class.allowedClasses = img-responsive
// Disable contextual menu
contextMenu.disabled = 1
// Display status bar
showStatusBar = 1
//More toolbar options
keepButtonGroupTogether = 1
// Use CSS formatting when possible
useCSS = 1
// Make rtehtmlarea resizable
rteResize = 1
proc {
allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
allowedClasses := addToList(detail,align-left, align-center, align-right, align-justify, csc-frame-frame1, csc-frame-frame2, component-items, action-items, component-items-ordered, action-items-ordered, important, name-of-person, indent, img-responsive)
allowedClasses < RTE.default.classesCharacter
# auskommentieren, damit klassen eingelesen werden können
#allowedClasses := addToList( dimmed,highlight,box,info,success,warning,error,float-left,float-right,center,align-left,align-center,align-right,align-justify,style1 )
## TAGS ALLOWED OUTSIDE P & DIV
allowTagsOutside := addToList( pre, img )
allowTags := addToList( pre )
// Tags allowed in Typolists
allowTagsInTypolists = br,font,b,i,u,a,img,span
// Keep unknown tags
dontRemoveUnknownTags_db = 1
// Allow tables
preserveTables = 1
entryHTMLparser_db = 1
entryHTMLparser_db {
// Tags allowed
allowTags < RTE.default.proc.allowTags
// Tags denied
denyTags >
// HTML special characters
htmlSpecialChars = 0
// Allow IMG tags
tags.img >
// Additionnal attributes for P & DIV
tags.div.allowedAttribs = class,style,align
tags.p.allowedAttribs = class,style,align
// Tags to remove
removeTags = center, font, o:p, sdfield, strike, u
// Keep non matched tags
keepNonMatchedTags = protect
}
// HTML parser
HTMLparser_db {
// Strip attributes
noAttrib = br
// XHTML compliance
xhtml_cleaning = 1
}
// Exit HTML parser
exitHTMLparser_db = 1
exitHTMLparser_db {
// Remap bold and italic
tags.b.remap = strong
tags.i.remap = em
// Keep non matched tags
keepNonMatchedTags = 1
// HTML special character
htmlSpecialChars = 0
}
}
}
RTE.default.FE < RTE.default
RTE.default.FE.showButtons < RTE.default.showButtons
RTE.default.FE.proc.allowTagsOutside < RTE.default.proc.allowTagsOutside
RTE.default.FE.proc.entryHTMLparser_db.tags.img >
// PageTSConfig
TCEFORM.tt_content.header_layout.altLabels {
0 = H1 (Default)
1 = H1
2 = H2
3 = H3
4 = H4
5 = H5
}
I also have same problem in my another project.
First set default_charset to utf8 in your php.ini file.
or you can manuaaly set it with below PHP code:
ini_set('default_charset', 'utf8');

Sending LDAP request with message ID

Need to send an LDAP search request with message ID set to 0 value (as part of RFC validation testing). Tried the following modified code from apache directory api examples section:
import java.io.IOException;
import org.apache.directory.api.ldap.model.entry.DefaultEntry;
import org.apache.directory.api.ldap.model.entry.ModificationOperation;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapNetworkConnection;
import org.apache.directory.api.ldap.model.message.SearchRequest;
import org.apache.directory.api.ldap.model.message.SearchRequestImpl;
import org.apache.directory.api.ldap.model.cursor.SearchCursor;
import org.apache.directory.api.ldap.model.exception.LdapNoPermissionException;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
public class ManageLDAPConnection {
private static Dn getSafeSearchBaseDn(String dn) throws LdapInvalidDnException{
Dn searchBaseDn = null;
if (dn != null && !dn.isEmpty()){
searchBaseDn = new Dn(dn);
}else{
searchBaseDn = Dn.ROOT_DSE;
}
return searchBaseDn;
}
public static void main (String[] args) {
int messageId = 0;
int port = 389;
String username = "<Admin CN>";
String password = "<Password>";
String hostname = "<IP>";
SearchCursor searchResult = null;
String dn = "<DN>";
String filterExpr = "(objectclass=*)";
org.apache.directory.api.ldap.model.message.SearchScope searchScopeValue = org.apache.directory.api.ldap.model.message.SearchScope.OBJECT;
LdapConnection connection = new LdapNetworkConnection(hostname, port);
try {
connection.bind(username, password);
System.out.println("Connected successfully");
} catch (LdapException e) {
System.out.println("Unable to bind");
}
try {
SearchRequest searchRequest = new SearchRequestImpl();
System.out.println(searchRequest.getMessageId());
searchRequest.setMessageId(0);
System.out.println(searchRequest.getMessageId());
searchRequest.setBase(getSafeSearchBaseDn(dn));
searchRequest.setFilter(filterExpr);
searchRequest.setScope(searchScopeValue);
searchResult = connection.search(searchRequest);
} catch (LdapNoPermissionException e){
System.out.println("No permission exception");
} catch (LdapException e){
System.out.println("LDAP Exception: " + e.getMessage());
}
}
}
The above code is able to send the request, but the message ID is still sent as non zero,
even though the following has been done:
searchRequest.setMessageId(0);
You're clearly going to have to use a different library, or modify this one, or go to a lower level. It isn't at all surprising that this library prevents you from shooting yourself in the foot.
Had some solution in python's pyasn1-modules. The following seems to work well:
from pyasn1.type import univ, namedval, namedtype, tag
from pyasn1.codec.ber import encoder
import socket
from pyasn1_modules.rfc2251 import *
ldap_bind_request = BindRequest()
ldap_bind_request.setComponentByName('version', 3)
ldap_bind_request.setComponentByName('name', 'cn=admin,o=org')
ldap_auth = AuthenticationChoice()
ldap_auth.setComponentByName('simple', 'mypwd')
ldap_bind_request.setComponentByName('authentication', ldap_auth)
ldap_message = LDAPMessage()
ldap_message.setComponentByName('messageID', 0)
ldap_message.setComponentByName('protocolOp', ldap_bind_request)
print(ldap_bind_request.prettyPrint())
print(dir(ldap_bind_request))
encoded_request = encoder.encode(ldap_message)
print(encoded_request)
asock = socket.socket()
asock.connect(('127.0.0.1', 389))
asock.send(encoded_request)
There is something named JAVA ASN.1 Compiler (JAC). Trying to see if they provide something similar, with less of object oriented complexity which is common in java :)

Resources