"Could not get the type info from component xml schema" when loading a page in SiteEdit 2009 - inline

I enabled inline editing on SitEdit 2009 SP2 using the answer given here
How do I enable inline field editing in SiteEdit when using an XSLT TBB?
but I keep getting this error when loading the resulting page in SiteEdit:
Sys.FormatException: Could not get the type info from component xml schema.
Field: cf_tcm:20-33457-64_content_header
XPath: [1]
My XSLT TBB fragment:
<xsl:if test="//*[local-name()='content_header'] != ''">
<h1>
<div>
<tcdl:ComponentField name="content_header" index="0">
<xsl:value-of select="//*[local-name()='content_header']">
</tcdl:ComponentField>
</div>
</h1>
</xsl:if>
The output in the published file:
<h1>
<div>
<span>
<!-- Start SiteEdit Component Field: {"ID" : "cf_tcm:20-33457-64_content_header", "XPath" : "[1]", "IsMultiValued" : false} -->
<tcdl:ComponentField name="content_header" index="0" SiteEditProcessed="true">
Test
</tcdl:ComponentField>
</span>
</div>
</h1>
What is wrong with my code?

That error message means that the XPath in your <!-- Start SiteEdit Component Field: { ...} --> command does not point to a field in the current Component. Given that your XPath shows up as [1], that sounds pretty accurate.
You'll need to find the cause of the empty XPath being output. In your XSLT you mark the field with a <tcdl:ComponentField> wrapper. This wrapper is later processed by the "Enable Inline Editing" TBB to generate a corresponding <!-- Start SiteEdit Component Field ... --> command. Since the SiteEdit front-end needs an XPath to the field and the tcdl:ComponentField only contains the field name, the TBB will need to look up the XPath based on the field name.
The "Enable Inline Editing" TBB from SiteEdit 2009 looks up the current Component when processing tcdl:ComponentField by looking at the current resolved item (engine.PublishingContext.ResolvedItem.Item.Id). It then looks up the field in that Component to determine its XPath.
If you look at the package in the Template Builder, what is the Component at the bottom of the Package list? Does that Component contain a content_header field?

Related

Siecore template field type resolution and solr when performing search query with sort

I'm trying to perform a search sort using Sitecore 9.3 and SXA. The default search configuration allows the user to sort by 'Title'. The search logs shows queries with &sort=title_t desc which is expected.
If I change the sort criteria from Title to Other Title via /sitecore/content/[site name]/Global/Settings/Facets/Title to a field other than title, I no longer get results from the search results call.
Looking in the search log shows that Other Title is not being resolved to other_title_t with the error ERROR Solr Error : [sort param field can't be found: other_title ]
The Sitecore documentation https://doc.sitecore.com/developers/93/platform-administration-and-architecture/en/using-solr-field-name-resolution.html described the mechanism for resolving fields to the correct type using index config
<fieldType
fieldTypeName="html|rich text|single-line text|multi-line text|text|memo|image|reference"
returnType="text"
/>
...
</fieldTypes>
which is then used with the the type match to append _t to the field name
<typeMatches hint="raw:AddTypeMatch">
<typeMatch
typeName="text"
type="System.String"
fieldNameFormat="{0}_t"
cultureFormat="_{1}"
settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration,
Sitecore.ContentSearch.SolrProvider"
/>
</typeMatches>
This does not appear to be working for sort.
I've found that adding the fieldName (rather then rely on the preconfigured type mapping ) works and result in other_title_t being used as the query sort.
<fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="other title" returnType="string" />
</fieldNames>
</fieldMap>
Should sort field resolution work via type field mapping already? Is this a bug?

af:inputFile is not calling valueChangeListener method

Summarize the problem
I'm trying to upload an image to a blob in the database and have been following various blogs online to do so.
Provide background including what you've already tried
I've tried enclosing the input file on a form but I get the warning:-
"Only one af:form is supported per page. This warning later escalates to a server exception error and I can't enter said page.
Show some code
<af:panelFormLayout id="pfl1">
<f:facet name="footer"/>
<af:form id="f1" usesUpload="true">
<af:inputFile label="Label 1" id="if1" value="#NewUploadImageBean.file}"
valueChangeListener="#{NewUploadImageBean.upLoadValueChangeListener}"/>
</af:form>
</af:panelFormLayout>
I only have this one form in the entire page.
Describe expected and actual results including any error messages
Would like to the valueChangeListner to call my method. Currently I get the
ADF_FACES-60097 error which then translates to : java.lang.IllegalStateException: ADF_FACES-30124:Multiple forms detected on viewId: /test_pages/employement.jsf. Rich client currently has some limitations in dealing with multiple forms.
How to fix ADF_FACES-30124:Multiple forms detected on viewId ?
To do so remove all the af:forms inside your jsf view expecially the one containing your inputFile and add only one af:form useupload="true" at the highest view tag level :
<af:document >
<af:form usesUpload="true" id="f1">
... ALL YOUR VIEW TAGS ...
</af:form>
</af:document>

Unable to get value from paper-input

<question-chrome question="{{question}}">
<paper-input label="{{question.Description}}" id="answer" name="answer" type="number">
{{question.Description}}
</paper-input>
</question-chrome>
Where question-chrome.html has the followign code:
<template>
<div class="questioncontainer {{question.Type }}" style="padding-top:10px;">
<div class="questiontext">
<span class="questiontitle">{{question.Title}}</span>
</div>
<div class="questionanswers">
<content select=".questionanswers"></content>
</div>
</div>
</template>
I am using the above paper input, when I am trying to get the values from this, I cannot find the value anywhere. the question element/object, I can get and see every other item's value of the question object. How would I get the value of what is put into the input field? in this case, the value was 3323.
this:
The code to retrieve it I have tried all of these:
this.$.answer.value;
And the results through developer tools in chrome result in:
Object
AdditionalProperties:null
Answers:Array[0]
Code:720061
Description:"Monetary marks ...."
ExtensionData:null
HasAnswers:false
HasChildren:false
Id:"9999dcc3-d3eb-40cf-8414-05ae385e11cf"
IsDefault:true
IsDeleted:false
.....so on and so forth
I went through all of these and did not find it. It is a numeric type of field, so not sure if that has anything to do with it.

Can solr produce highlight position info for Adobe XML highlighting spec?

There is a PDF highlighting spec from Adobe that allows one to provide an XML file describing highlight locations to a PDF viewer API. Can Solr produce the highlighting info necessary to produce such a file? Mandatory info would be: page, position, and length. If the answer is yes, any tips on configuring the Solr highlighting component?
Sample XML higlighting file:
<XML>
<Body units='characters' color='#ff00ff' mode='active' version='2'>
<Highlight>
<loc pg='0' pos='0' len='6' />
<loc pg='2' pos='1' len='10' />
</Highlight>
</Body>
</XML>

how to insert html tag inside sql in Liquibase migration?

I need to update my data that have html tag inside so wrote this on liquibase
<sql> update table_something set table_content = " something <br/> in the next line " </sql>
it apparently doesn't work on liquibase ( i got loooong errors .. and meaningless). I tried to remove <br/> and it works.
my question is, is it possible to insert / update something that contains xml tag in Liquibase ?
I am using liquibase 1.9.3 with Grails 1.1.1
edited: forgot to set code sample tag in my examples.
As the liquibase author mentions here you'll need to add CDATA section inside <sql>.
In your particular example that would become:
<sql><![CDATA[ update table_something set table_content = " something <br/> in the next line " ]]></sql>
Even better not to use a <sql> tag at all (I added the where clause ...):
<changeSet author="author" id="table_something_1">
<update tableName="table_something">
<column name="table_content"><![CDATA[ something <br/> in the next line ]]></column>
<where>id=1</where>
</update>
<rollback />
</changeSet>

Resources