Registered theme with xml import not use setted default layout template - websphere-portal

I am using WebSphere 8.0. In my imported xml for theme registration I set com.ibm.portal.layout.template.href to existed layout 1Row2ColumnUnequal.
<parameter name="com.ibm.portal.layout.template.href" type="string" update="set"><![CDATA[war:ErkcThemeStatic/themes/ErkcTheme/layout-templates/1Row2ColumnUnequal/]]></parameter>
But after applying theme default layout template sets to 1Column. Here is the full xml.
<?xml version="1.0" encoding="UTF-8"?>
<request type="update" version="8.0.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_8.0.0.xsd">
<portal action="locate">
<skin action="update" active="true" default="false" domain="rel" objectid="ErkcDefault.Skin" uniquename="ErkcDefault.Skin" resourceroot="ErkcDefault.Skin" context-root="/ErkcThemeStatic" type="default">
<localedata locale="en">
<title>Erkc Default Skin</title>
</localedata>
<parameter name="com.ibm.portal.skintype" type="string" update="set"><![CDATA[template]]></parameter>
<parameter name="com.ibm.portal.skin.template.ref" type="string" update="set"><![CDATA[res:/ErkcThemeStatic/skins/ErkcDefaultSkin/]]></parameter>
<parameter name="com.ibm.portal.skin.template.file.name.html" type="string" update="set"><![CDATA[skin.html]]></parameter>
</skin>
<skin action="update" active="true" default="false" domain="rel" objectid="Erkc.Hide" uniquename="Erkc.Hide" resourceroot="Erkc.Hide" context-root="/ErkcThemeStatic" type="default">
<localedata locale="en">
<title>Erkc Hide Skin</title>
</localedata>
<parameter name="com.ibm.portal.skintype" type="string" update="set"><![CDATA[template]]></parameter>
<parameter name="com.ibm.portal.skin.template.ref" type="string" update="set"><![CDATA[res:/ErkcThemeStatic/skins/ErkcHideSkin/]]></parameter>
<parameter name="com.ibm.portal.skin.template.file.name.html" type="string" update="set"><![CDATA[skin.html]]></parameter>
</skin>
<skin action="locate" domain="rel" objectid="ErkcDefault.Skin.objectID" uniquename="ErkcDefault.Skin"/>
<skin action="locate" domain="rel" objectid="Erkc.Hide.objectID" uniquename="Erkc.Hide"/>
<theme action="update" active="true" context-root="/ErkcThemeDynamic" default="false" defaultskinref="ErkcDefault.Skin.objectID" domain="rel" resourceroot="dynamicSpots" uniquename="Erkc.Theme">
<localedata locale="en">
<title>Erkc Theme</title>
</localedata>
<allowed-skin skin="ErkcDefault.Skin.objectID" update="set" />
<allowed-skin skin="Erkc.Hide.objectID" update="set" />
<parameter name="com.ibm.portal.theme.dnd.sources" type="string" update="set"><![CDATA[ibmDndColumn:com.ibm.pb.dnd.layout.LayoutColumnSource:vertical,ibmDndRow:com.ibm.pb.dnd.layout.LayoutRowSource:horizontal]]></parameter>
<parameter name="com.ibm.portal.theme.aggregationmodes" type="string" update="set"><![CDATA[ssa]]></parameter>
<parameter name="com.ibm.portal.layout.template.href" type="string" update="set"><![CDATA[war:ErkcThemeStatic/themes/ErkcTheme/layout-templates/1Row2ColumnUnequal/]]></parameter>
<parameter name="com.ibm.portal.theme.template.ref" type="string" update="set"><![CDATA[war:ErkcThemeStatic/themes/ErkcTheme/]]></parameter>
<parameter name="resourceaggregation.profile" type="string" update="set"><![CDATA[profiles/profile_deferred.json]]></parameter>
<parameter name="com.ibm.portal.theme.hasBaseURL" type="string" update="set"><![CDATA[true]]></parameter>
</theme>
</portal>
</request>

your xmlaccess shows you are on 8000 portal I would recommend at LEAST getting to 8001 as there were many defects around in this in 8000

Related

Apache Solr Query Parse Error during data import when using SolrEntityProcessor

When I try to do import of schooLocationDetails solr core, I get below error . Using Solr 5.3.1
Exception while processing: opportunityDetails document : SolrInputDocument(fields: []):org.apache.solr.handler.dataimport.DataImportHandlerException: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://:<solr_pwd>#<solr_server>:<solr_port>/solr/locationCore: org.apache.solr.search.SyntaxError: Cannot parse 'locationId:': Encountered "" at line 1, column 22.
Below is my data-config.xml for the solr core schooLocationDetails.
<dataConfig>
<document>
<entity name="school" dataSource="datasource" query="select * from school_table" transformer="RegexTransformer">
<field column="recordKey" name="recordKey" />
<field column="name" name="name" />
<field column="location" name="location" />
<field column="title" name="title" />
</entity>
<entity name="locationDetail" processor="SolrEntityProcessor" url="http://<solr-user>:<solr_pwd>#<solr_server>:<solr_port>/solr/locationCore" query="locationId:${school.location}"
fl="*,old_version:_version_">
<field column="locationId" name="locationId" />
<field column="city" name="city" />
<field column="state" name="state" />
<field column="old_version" name="old_version" />
</entity>
</document>
</dataConfig>
You have to add the entity referencing the value inside the other entity. When they're two separate entities, they can't reference each other values (and they'll be imported after each other instead).
<entity name="school" dataSource="datasource" query="select * from school_table" transformer="RegexTransformer">
<field column="recordKey" name="recordKey" />
<field column="name" name="name" />
<field column="location" name="location" />
<field column="title" name="title" />
<entity name="locationDetail" processor="SolrEntityProcessor" url="" query="locationId:${school.location}"
fl="*,old_version:_version_">
<field column="locationId" name="locationId" />
<field column="city" name="city" />
<field column="state" name="state" />
<field column="old_version" name="old_version" />
</entity>
</entity>

how to import csv file into solr with dataimporthandler

I have a solr project. I want to put my csv file data into solr using dataimporthandler. I wrote this db-data-config.xml.
<dataConfig>
<dataSource type="FileDataSource"/>
<document>
<entity name="item" processor="FileListEntityProcessor" fileName="TableArchive.csv" baseDir="${solr.install.dir}/server/solr/archiveCore" dataSource="null" recursive="true" rootEntity="false">
<field column="NameAdded" name="NameAdded" />
<field column="DateAdded" name="DateAdded" />
<field column="NameModified" name="NameModified" />
<field column="DateModified" name="DateModified" />
<field column="strSO" name="strSO" />
<field column="strCust" name="strCust" />
<field column="strOperator" name="strOperator" />
<field column="PackName" name="PackName" />
<field column="DocName" name="DocName" />
</entity>
</document>
</dataConfig>
When I run data import handler from solr admin panel, it not indexing files. I don't know how to solve it.

How to configure Tesseract language for TikaEntityProcessor in Solr

I have a solr core, and i use TikaEntityProcessor in my DataImportHandler.
I have tesseract installed and tika can extract text from images. But the default language is english.
Here is the tika part of my data-import-handler.xml file
<entity processor="TikaEntityProcessor" dataSource="fileDataSource"
name="file_content"
url="${item.FilePath}"
format="text" transformer="TemplateTransformer"
onError='skip'>
<field column="text" name="content" />
<field column="title" meta="true" name="title" />
<field column="subject" meta="true" name="subject" />
<field column="description" meta="true" name="description" />
<field column="Author" meta="true" name="author" />
<field column="category" meta="true" name="category" />
<field column="content_type" meta="true" name="content_type" />
<field column="last_modified" meta="true" name="last_modified" />
</entity>
I also have tur.traineddata and rus.traineddata in tesseract's tessdata folder, and i want to use Turkish as default ocr language.
How can i do that ?

Solr only index content whose text has a specified minimal length/size

I'm trying to import the allemanic wikipedia xml-dump. I specified some regex rules to ignore wikipedia pages like categories, files, templates, ... This configuration does work without any problems.
But then I wanted to restrict the indexing to documents that have a contents field with a length of at least 200 characters. But I cannot think of any way to do it. I tried some regex but then the indexing would always instantly fail (something like (.*){5} doesn't seem to be supported?).
Does anyone know a regex that is supported by solr to skip documents with only 200 or less characters? Or is there any other way to achive this behaviour?
<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" />
<document>
<entity name="page" processor="XPathEntityProcessor" stream="true" forEach="/mediawiki/page/" url="/home/patrick/Desktop/alswiki-20130413-pages-articles.xml" transformer="RegexTransformer,DateFormatTransformer,HTMLStripTransformer,TemplateTransformer">
<field column="origid" xpath="/mediawiki/page/id" />
<field column="id" regex="^(.*)$" replaceWith="als-$1" sourceColName="origid" />
<field column="name" xpath="/mediawiki/page/title" />
<field column="revision_id" xpath="/mediawiki/page/revision/id" />
<field column="user" xpath="/mediawiki/page/revision/contributor/username" />
<field column="contents" xpath="/mediawiki/page/revision/text" stripHTML="true" />
<field column="timestamp" xpath="/mediawiki/page/revision/timestamp" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'" />
<field column="source" template="Swiss Wiki"/>
<field column="$skipDoc" regex="^#REDIRECT.*" replaceWith="true" sourceColName="contents"/>
<field column="$skipDoc" regex="^#WEITERLEITUNG.*" replaceWith="true" sourceColName="contents"/>
<field column="$skipDoc" regex="^#Redirect.*" replaceWith="true" sourceColName="contents"/>
<field column="$skipDoc" regex="^Wikipedia:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^MediaWiki:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^Vorlage:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^Datei:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^Hilfe:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^Portal:.*" replaceWith="true" sourceColName="name"/>
<field column="$skipDoc" regex="^Kategorie:.*" replaceWith="true" sourceColName="name"/>
</entity>
</document>
</dataConfig>
Firstly, (.*){5} will match exactly 5 characters. (.*){5,} will match five or more. So for 200, it would be (.*){200,}.
If this doesn't work, it is reasonably easy to write a custom transformer:
http://wiki.apache.org/solr/DIHCustomTransformer

I want to use multiple datasources in DataImporthandler in Solr and pass URL value in child entity after querying database in parent entity

I want to use multiple datasources in DataImporthandler in Solr and pass URL value in child entity after querying database in parent entity.
Here is my rss-data-config file:
<dataConfig>
<dataSource type="JdbcDataSource" name="ds-db" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/HCDACoreDB"
user="root" password="CDA#318"/>
<dataSource type="URLDataSource" name="ds-url"/>
<document>
<entity name="feeds" query="select f.feedurl, f.feedsource, c.categoryname from feeds f, category c where f.feedcategory = c.categoryid">
<field column="feedurl" name="url" dataSource="ds-db"/>
<field column="categoryname" name="category" dataSource="ds-db"/>
<field column="feedsource" name="source" dataSource="ds-db"/>
<entity name="rss"
transformer="HTMLStripTransformer"
forEach="/RDF/channel | /RDF/item"
processor="XPathEntityProcessor"
url="${dataimporter.functions.encodeUrl(feeds.feedurl)}" >
<field column="source-link" dataSource="ds-url" xpath="/rss/channel/link" commonField="true" />
<field column="Source-desc" dataSource="ds-url" xpath="/rss/channel/description" commonField="true" />
<field column="title" dataSource="ds-url" xpath="/rss/channel/item/title" />
<field column="link" dataSource="ds-url" xpath="/rss/channel/item/link" />
<field column="description" dataSource="ds-url" xpath="/rss/channel/item/description" stripHTML="true"/>
<field column="pubDate" dataSource="ds-url" xpath="/rss/channel/item/pubDate" />
<field column="guid" dataSource="ds-url" xpath="/rss/channel/item/guid" />
<field column="content" dataSource="ds-url" xpath="/rss/channel/item/content" />
<field column="author" dataSource="ds-url" xpath="/rss/channel/item/creator" />
</entity>
</entity>
</document>
What I am doings is in first entity named feeds I am querying database and want to use the feedurl as the URL for the child entity names rss.
The error I get when I run the dataimport is:
java.net.MalformedURLException: no protocol: nullselect f.feedurl, f.feedsource, c.categoryname from feeds f, category c where f
.feedcategory = c.categoryid
the URL us NULL meaning its not assigning the feedurl to URL.
Any suggestion on what I am doing wrong?
Here's an example:
<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>
<dataSource name="db1" ... />
<dataSource name="db2"... />
<document>
<entity name="outer" dataSource="db1" query=" ... ">
<field column="id" />
<entity name="inner" dataSource="db2" query=" select from ... where id = ${outer.id} ">
<field column="innercolumn" splitBy=":::" />
</entity>
</entity>
</document>
the idea is to have one definition of the entity nested that does the extra query to the other database.
you can access the parent entity fields like this ${outer.id}

Resources