Display large rich text field values on to the web in XPages - xpages

I have a rich text field storing comma separated numbers (large numbers from 11111 to 99999 with three character prefix - so xxx11111, xxx11112 etc). I am using the appendText property and in the document I noticed that after around 16KB another rich text field with the same name is created.
But when I display this information on the web:
<xp:inputRichText id="inputRichText1" readonly="true" value="#{doc.RichTextField}">
</xp:inputRichText>
it's only displaying upto xxx16351. What am I missing here?
Any help would be appreciated.

You might want to alter your approach. What should work is Tim's MIME usage. So instead of RichText you write into a MIME field and the Domino engine takes care of size and rendering.
In any case, speak after me:
There is no RichText on the web, it is a ghost of Christmas past, there is only MIME.
Let us know how it goes

Is it only displaying the content from the first rich text field? I suspect that the value binding to fields will only retrieve from the first NotesItem with that name, rather than aggregating all NotesItems with that name.

Related

HCL Notes: How to increase limit for text?

For a project I am programming in HCL Domino and using a Notes Database. My problem is that the value I want to store as text is greater than the maximum limit for text (32KB).
As an alternative rich text came into my mind. Within the application it works just fine. Yet if I directly apply any changes in the database the text will be formatted differently. If I use the application again the text will be look something like this:
<font size="2" face="sans-serif"><?xml version="1.0" encoding="UTF-8"?><br /> ...
But instead it should be xml Code:
<?xml version="1.0" encoding="UTF-8"?> ...
Is there any way to avoid this problematic? Is it even possible to change the maximum capacity for the normal text field? (with text it worked fine) For me it seems like the additional features of rich text like formatting text are causing the problem.
I have no Idea what you do to change the content of the text item as you do not provide any code what makes debugging nearly impossible. The easy way to achieve what you want is to use a NotesItem and set its "IsSummary" Property to False.
Be aware: Don't store a document with such a value in frontend, otherwise the 32k limit will come back. Here is some example code:
Dim bigItem as NotesItem
'- for new docs
Set bigItem = New NotesItem( doc, "NameOfYourItem" )
'- for existing docs
Set bigItem = doc.GetFirstItem( "NameOfYourItem" )
bigItem.IsSummary = False
bigItem.Values = "YourIncredibleLongValue"
You cannot show items that are non summary in views (same as Richtextitems), so depending on what you want to achieve this might not be a solution for you.
As an alternative to Torstens answer on using a non summary field, you can use the Large Summary option introduced in Domino 9.01 FP8 to increase the limit to 64K for text fields:
load compact -LargeSummary on database.nsf

Hybris: Use same field for search and facet

I have to use a field "manufacturerName" for both solr search and solr facet in Hybris. While the solr free text search requires the field type to be text, the facet only works properly in string type.
Is there any way to use this same field for both search and facet. I think there is one way by using "copyField" but I searched a lot, and still don't know how to use it?
Any help would be highly appreciated!
PS: On keeping the field type string, free text search doesn't fetch proper results. On keeping the field type text, facet shows truncated values.
Using a copyField instruction is the way to go, but that require you to define an alternative field - meaning you have one field with the type text and the associated tokenization, and one field of the type string which isn't processed in any way. There is no way in Solr to combine these in a single field that I know of.
You'll then use the name of the string field to generate the facets, while you use the other field when you're querying.
<copyField source="text_search_field" dest="string_facet_field" />
You'll then have to refer to the name string_facet_field when you're filtering or faceting on the field. You'll want to filter against the facet field after the user selects a facet, since you otherwise would end up with documents from other facets possibly leaking into your document result set (for example if the facet was "Foo Bar", you'd suddenly get documents that had "Baz Foo Bar Spam" as the facet, since both words are present in the search string.
I was not able to implement the "copyField" approach, but I found another easy way to do this. In solr.impex, I had already added my new field manufacturerNameFacet of type string, but there is a parameter "fieldValueProvider" and "valueProviderParameter". I provided these values as "springELValueProvider" and the field I wanted to use for search and facet "manufacturerName". After a solr full indexing, it worked like a charm. No other setting was required. The search and facet both were working as expected.

What exactly is a Lotus Notes document's "size" field?

Background is that I am trying to eliminate duplicated documents that have arisen (from a rogue replication?) in a huge database - tens of thousands of docs. I am composing a view field that uniquely identifies a document so that I can sort on that field and remove the duplicates via LotusScript code. Trouble is that there is a rich text "Body" field that contains most of the action/variability and you can't (AFAICS) use #Abstract in a view column...
Looking around for an alternative I can see that there is a system variable "size" which includes any attachments size, so I am tentatively using this. I note that duplicated docs (to the eye) can differ in reported size by up to about 30 bytes.
Why the small differences? I can code the LS to use a 30-byte leeway, but I'd like to know the reason for it. And is really 30 bytes or something else?
Probably document's item $Revisions has one more entry. That means that the document was saved one more time.
If the cause of this "copy thousands of documents" accident was replication then you might be lucky that documents contain an item $Conflict. This item contains the DocumentUniqueId of the original document and you could pair them this way.

MediaLibraryPickerField : how to pick only provided Content types?

MediaLibraryPickerField has a seeting named "DisplayedContentTypes". I think it is used to provide only required content types that I want my picker field to select and render. But somehow it is not working.
E.g: I want to select only Image,OEmbed types. I put it in the settings area's text box:
Content Types and Parts
[Image,OEmbed]
A comma separated value of all the content types or content parts to
display.
and saved it. But it is still picking all kind of media and rendering them.
Any thing I might be missing here??
There is an open issue here https://orchard.codeplex.com/workitem/21051
There is no fix yet although.
Indeed, the property exists but is not used.
We should try to implement a filter, as it is done for the content picker field.

How to make RichTextValue catalog full text search for Plone 4

I created dexterity content type with Rich Text Field - "body text". I'd like to make "body text" full text searchable for my Plone 4.0.2.
I added catalog.xml in my theme, code below
I got error message from ZMI/portal/portal_catalog "body_text RichTextValue object. (Did you mean .raw or .output?) "
How can I change catalog.xml to use .output, I tried , but it doesn't work.
Thanks.
You could use plone.indexer and provide your own indexer inside your dexterity type to add your custom body text to the SearchableText index (including default title and description for example) like so:
#indexer(IMyTypeInterface)
def SearchableText(obj):
return ' '.join([obj.Title(), obj.Description(), obj.bodytext.output])
Disclaimer: I have not encountered this issue myself, so this is just a guess.
Archetypes and others use SearchableText() index/accessor to populate the full text search index for Plone search.
You probably need to add SearchableText() method to your content type and make it return all the text concatenated which you want full text search to pick up.
Christoph's suggestion of a custom indexer is a good one. You can also use this add-on: collective.dexteritytextindexer

Resources