How to display and work with tabbed table in XPages? - xpages

I have database where all documents were created by Lotus Notes client. Documents contain Rich text field with tabbed tables with text and attachments on every tab.
Now I want to show documents with XPages. But tabbed tables are not visible in XPages.
How can I display Rich text field with tabbed table in XPages?

The answer isn't as straight forwarded as you would like and involved some wizardry. There are several moving parts. The first is the quality of the RTF-HTML conversion. I superstrongly suggest you give Ben a call. In case he doesn't handle tabbed tables (which are a beast), these are the steps to get a solution (I hope the force Javascript is strong with you):
Familiarize yourself with the Table handling and rendering. To do so, open the RichText field on its own in the browser. The trick is the ?OpenField command as documented by Carl.
In that HTML you can click on the various tabs to show that content, look at the URL and the source to learn about the exact syntax (which AFAIK isn't documented - or the documentation is well hidden)
By now you should have an idea how to identify a tabbed table by its HTML markup. Try to construct a Dojo selector or a JQuery (whatever is your poison).
Now show your page without the RichText field, but place a placeholder <div id="RTPlaceholder" /> where you want to show your content (or place a dijit panel there).
Use an Ajax call to ?OpenField to get the content. With your query expression you check for tabbed tables - if none there, just render the content
If you found a tabbed table, you construct a dijit tabbed table (or a UI framework of your choice equivalent) and make one call per tab to fill them. Some clever queries are needed (you don't want the surrounding table, but only tab-label and content).
That's the general direction. So Step 1: a little chat with Ben. As usual the devil is in the details, so you need to be brave.
Memento bene:
RichText > HTML => false;
HTML > RichText => false;
HMTL != RichText => true;
Let us know how it goes!

Related

Kentico13 - How to add content teasers in richtext field?

We are using Kentico XP 13.0.44. Our content editors create news articles with rich text fields in built-in CKEditor v4.14.
Our editors ask for a feature to insert content teasers into rich-text. My idea was to create a custom CKEditor plugin and utilize Kentico's "Insert Link" dialog (editor.config.LinkDialogURL).
This works, but ideally I would like to hide all tabs except "Content". I tried to add query parameters like &anchor_hide=1&email_hide=1&libraries_hide=1&web_hide=1 to the "/CMSFormControls/Selectors/InsertImageOrMedia" LinkDialogURL but that doesn't work.
Is there a way to somehow customize this dialog or create custom dialogs for CKEditor? Am I on the wrong track and is there a better solution?

Is there any way we can display web-content on public page randomly on page refresh?

We are using liferay 6.1
On Public page we want to display web-content in one portlet, but it should not be only selected one.
we want to display it randomly on page refresh. Like on page refresh it should display different web content from group of web content.
Any hint ?
Thanks.
Consider to use structures & templates: With structures you give some contents of an article - this might be alternative content, or just a description of a filter that you want to display.
A simple structure (that contains all of the content in just one article, not exactly what you ask for) just has repeatable HTML text fields. Edit all of them with the content you want to show alternating.
In your template you read an article with this content, generate a random number and only show the fragment from the content that the random number suggests.
Another way is to have a template that queries Liferay's API for several articles. Then you randomly select one of them and display it.
Templates can be written in Velocity, Freemarker or XSL. The nice thing is they're completely runtime-configurable.
Liferay Blogs, particularly those of James Falkner, have a few articles on how to work with the API from templates.
You can customized the "Web Content Display" portlet with a hook.
Add to config-page the "show randomized" checkbox, get the list of existing journal articles and choose random one of them.

Converting richtext to MIME / HTML?

I have a old Notes Database that was designed with tradtional Notes forms for both the client and the web.
I still want to keep the old database in the traditonal Notes client. But display the rich text as HTML in xpages.
I selected the Store contents as HTML and MIME on the rich text field on the form but when I do, it destroys all of the formatting and removes things like collapsable sections. But it does allow the content to be displayed even though it is not pretty.
I found this thread:
XPages RichText Links
Where Steve recommends using that option.
He goes on with a further solution that I am not sure I understand it at all.
We have lots and lots of content, so asking the users to redo it all manaully is not an option. Is there anyway we can either just display this rich text content or at least convert it while keeping all of the formatting and collapsible sections?
When you check that option you destroy the existing content formatting if you don't convert the content. The conversion is not perfect and is what the RichText control does on the fly.
The set of actions you want to take:
get the coexedit plugin or the
add a new RT field with the MIME
run an agent to
optional: remove the old field and rename the new to the old name (make sure mime stays checked)
For read only access (both options get better with the coexedit plugin) :
use the RichText control, no further action is required
use a Dojo panel. It has a href property you point to ... Body?OpenField, no further action is required
Note:the later doesn't work in XPiNC

Opening different xpages forms from a view panel

I have an Xpages application that pulls data from another .nsf file. I have a view panel linked to a view in that db. The view has documents with several different forms in it. I want to be able to open each document in it's own form(xpage).
How do I write a computed At Runtime, open selected document using: statement that will select the correct Xpage to present the document.
If you use the Data View component instead of a View Panel, you can compute the pageName attribute, referencing the var attribute to return a different value for each row based on the document that row represents. The flexibility of the Data View component also makes it easier to make your app look more like a modern web application and less like an Excel spreadsheet. As an additional bonus, the mobile theme invokes a renderer that makes each Data View instance look like a native mobile list, so using Data Views instead of View Panels simplifies mobile development.
You have 2 options:
use "use xpage associated with form" and edit the form's property
use a SSJS formula to compute the Form. You provide a variable name in the view control var to access a view row as XSPViewEntry. If the Form is in a view column even one you don't display you use .getColumnValue otherwise getDocument.getItemValueString
Does that work for you?
Maybe this mothed can help you: Unable to get document page name for
Hope this helps
Mark
I had a similar problem today. I use only one form but 3 different xpages for associated with this form. I have 3 different document types in the view. I used rowData the get the type of the document.
try{
var v=rowData.getColumnValue("form");
if(v.indexOf("x")> -1){var page ="x.xsp"}
else if(v.indexOf("y") > -1){var page = "y.xsp"}
else{var page = "z.xsp"}
}catch(e){
var page = "x.xsp"
}
So to your view you can create a column with the value of the form and you can use it.
I have used the extension library Dynamic View control which has an event you can code to get a handle to the NotesViewEntry which was selected. See the demo database page Domino_DynamicView.xsp and the Custom Event Handler tab for an example.
Note, in 8.5.3 (I have not upgraded yet) if you add or edit the eventHandler for onColumnClick it will be added to the XPages source as an xe:eventHandler. It needs to be an xp:eventHandler to work. The way to do it is to copy the code in the source from the exiting event and delete it. Recreate the event and update the code. Then go back into the source and change the tags within the eventHandler to xp:.

Default content editor in list form doesn't allow image alignment

I need to be able to adjust the alignment of an image in an "Enhanced Rich Text Field" in an announcements list in MOSS 2007. However, the default content editor in the edit form for the list doesn't provide a way to do that. What's the fastest way for me to make sure users can align images? My first thought was to customize the DispForm.aspx and EditForm.aspx pages, but they just have the ListForm web part in the content region and as far as I know, you can't customize the ListForm web part from the designer.
You can't customize the LisForm web part, but you can add a "custom list form" to create a custom edit form. Maybe you haven't seen this article: http://weblogs.asp.net/jan/archive/2006/11/06/Custom-Edit-Forms-for-SharePoint-2007-Lists.aspx
Then you could do some javascript hackery to insert your own button which then calls something similar to existing RTE_InsertImage function to call a pop-up window and do whatever you need (you'll find this function in 12\template\layouts\1033\form.js)
I fail to see (or understand) your issue. I created a new announcements list, created a new item, inserted an image, aligned it to the right, viewed the item and it worked.
Then I proceeded to create a new custom column, choose multiple lines,enhanced rich text field, edited my list item, added an image, centered it, viewed and it was also working.
The only thing I noticed is that the "rich" control does not appears on non-IE browsers.

Resources