Xpages - Value picker UI customization - xpages

I want to create a custom value picker which can have:
Same labels
Can't use simple Domino view value picker as I need to check individual entry for some business criteria
I want to show a short summary as well to help user distinguish among similar labels (I want to add some formatting to it e.g. label in bold, summary in green small chars)
I can create an Xpage for all such value pickers or I can have a custom data provider. Now, my question is, do I need to create a custom renderer as well to display Label with summary? How do I implement the picker with modal look-n-feel (I am using bootstrap theme)?
Thanks in advance
Arun

Version 12 of the Extension Library included the code I contributed for Map Picker Data Provider and Collection Picker Data Provider. Implementing data provider outside the Extension Library packages is quite complicated - there are a lot of methods used for getting options etc that are protected, so they need reproducing. They're currently designed to take a label and value only, so they would need extending to take a summary as well.
I don't think the picker can take HTML as a picker option - that would allow you to pass in the formatting for the label and the summary. I've not tried it, but if it was allowed it would impact searching etc, so that makes me suspect it's unlikely.
Creating a renderer with bootstrap look and feel is possible. I'd recommend looking at the Extension Library renderers. It looks like the picker renderers handle the link on the page and separate classes handle the dialog that's displayed.

Related

Conditional fields in Liferay Web Content editor

We have a requirement for creating a banner for which we plan to use Web Content Display.
As part of the implementation I have created a structure with the required fields like link-type (drop-down), etc and using corresponding template.
I wish to make a conditional check based on the type of selection in the link-type and show link-to-page or text-box.
I observed that there is no option to have a conditional check in the article editor rendering.
Thus I wish to check whether there is any hack or trick that we can do to achieve the above conditional thing?
Also, can we inject custom Javascript to achieve this as part of the structure?
I finally have to stick to the default options in the liferay structure. I plan to use separator provided by LR to categories the elements to avoid end user (admin) confusion.
P.S. I was not able to locate any cool doc that would help in implementing the suggestion made by #Tobias (sorry, but I guess the wiki link above assumes you to be an expert of LR, and even the sample links in there does not work).

Sharepoint html element naming conventions, by Sharepoint Controls

A few times I've attempted to customize a SP2007 page using css, html, or javascript in Sharepoint Designer; however, in Sharepoint Designer I am not able to get direct access to the desired elements since they are generated by a Sharepoint Control (such as a web part or dataview) and appear only AFTER the page is rendered in the browser. I use use IE's F12 to tracked the element I wish to change. Then I can see an identifer such as name or id I can use in my javascript or css.
Example 1: SP2007 generates "name=ctl00$PlaceHolderMain$g_ba9196a9_2842_4607_b048_9a443cb4def5$ff2_1$ctl00$ctl00$BooleanField" for an input text box. I use that name to manipulate the text box as I desire.
Example 2: SP2007 generates "id=zz6_menu" for the "Welcome" text which I use to get the users full name.
So far this has worked out fine. Am I tempting fate?
Can someone refer me to a reference that discusses how these names and other Sharepoint Control element identifiers are generated?
Are they stable? Can I count on them to be the same provided the application I develop with my version of SP isn't updated to a later version of SP? And even if that case I'm thinking I can simply update to the identifiers created by the newer version of SP.
Is this a good practice? Any other comments?
All responses are welcomed.
Thanks.
SharePoint is based on ASP.NET and that's why the Ids are automatically genereated.
cf this article.
You should not use them to identify elements on css or js.
Do not write code that references controls using the value of the
generated UniqueID property. You can treat the UniqueID property as a
handle (for example, by passing it to a process), but you should not
rely on it having a specific structure.
In my opinion, the best way is to rely on the css classes because they are not automatically generated and should not change a lot.
Anyway, if you upgrade to SP2010 or 2013, lot of your modifications won't work anymore because the structure and css changed...

Orchard Module Override a Field Driver

Hello fellow Orcharders!
I'm not sure if what I want to do is possible, but I want to override the Driver for a single Field in the Module I'm writing.
The Field I want more control over is the Content Picker field. Basically I want the Content Picker to load the shapes for their respective content items. I've looked at Sipke's Content Picker Widget for an example on how to load shapes, however I'm unsure of the best/recommended approach to implement something similar in my module.
I have the Content Picker Field attached to my Content Part, and the default Content Picker comma list of Content Item titles appears as expected. I have tried to define an Alternate in Placement.info, but I can't load the Content Item shapes from within the Alternate view.
Presumably, as per Sipke's example, these shapes need to be built in the Driver and passed along. If this is correct thing to do, how could I do this in the most Orchard-y way with minimal "hacks". Looking into the debugger, I could "hack" my way to the Field I need in my part's Driver; but the module I'm building will be reused in the future by people unfamiliar with it, and if they start adding/deleting Fields from the Content Part, I'd like everything to behave accordingly!
Of course, if I must take the "hacky" option, I'm willing to do so, but only after I've exhausted all other options. This is my first module, and I've learnt an incredible amount along the way, and I'm really trying to learn the "right" way to build an Orchard Module as best I can.
Thanks in advance!

How to integrate a "shortcode" feature in Sharepoint wikis

I would like to "customize" my sharepoint wiki by doing something very simple.
I would like to be able to run a regex on wiki pages looking for [math] and [\math] tags, then take the expression written in the middle (assume this value is stored in a variable x) and replace the whole block by
"<img src='http://latex.codecogs.com/gif.latex?" + x +"'/>"
So for example, the shortcode [math]a^2+b^2=c^2[\math] should end up being displayed as an image as follows (thanks to this online tool):
I have never developed anything in sharepoint, and I've been using it for a week.
Can anybody tell me how I should proceed to add such a feature (if it's possible)?
You can use existing solution like ShortPoint.
Sure - this is simmply done via two methods - 1) You could modify the page directly using SharePoint designer - fly in the code where you want it, 2) The better way - add your code to text file, upload the text file to a document library then use the Content Editor web part, drop it on the page, point it (through the properties) to the text file.
Note: The Content Editor part will allow you to modify the background HTML/Script, however, it has a nasty habit of overriding your code and I've had it actually duplicate itself (adding repeat scripts). Using the Text file eliminiates that issue.
If i understand you correctly, I don't think that the content editor web part is the solution you are looking for. I believe you are wanting to implement a shortcodes solution such as that found in WordPress, correct? In that case, the issue becomes a bit more complex. To really get any kind of custom code that would execute at the necessary stages, you would need a custom solution either implementing additional functionality in the existing rich text editor, or roll your own custom rich text editor.
At that point, you would have complete control over how the content is parsed and interpreted, so you could have both server-side and client side processing. You could make use of templating engines like mustache or handlebars.
To do this, you would need to write your own Custom field type, inherit from SPFieldMultiLineText, override the property FieldRenderingControl, and return your custom control. That way you have the option of implementing it in several different places (custom pege fields in a page layout, custom webparts, custom lists, etc.) and you still get the benefits you want from the out-of-the-box control.

locate forms into view directory folder lotus notes

I created a form to display a specific report instead of a view. iwant the form to locate into the directory folder in which views located. for eg I have a view at 1. Reports\a. Quarterly Reports, I want the reports be to located at 1. Reports\b. No of Request per Country(this is the form). So that when I view the reports they are only in one location. Is this possible?
Ken has good points about the design of the solution. If you need more direct assistance, then I can offer the following solution.
As you're now using a variety of design elements. You need to unify it using a frameset and an outline. Framesets in Notes are the generally the same as their web counterpart. The great thing with Notes is that you can easily add this to your current design.
I would recommend the following order of tasks.
Create the outline. Instructions here
Create the frameset and connect the outline to it. Instructions here.
Set the database launch properties so the frameset loads up when people open the database. Instructions here.
Even though the links point to Lotus Notes version 6, the functionality is still applicable in version 7 and 8. The only other point I would make is that when you click on an outline element it needs to know where the target location to display the data. You define this on the frames in the framesets. Just look at the menu option "Frames" and select "Frame properties" or "Frameset properties" respectively.
You can use a Notes Outline to manage this. Set one up for your database, if you haven't already, and use it as your left-hand navigation in your frameset. If you aren't sure what I'm talking about, try creating a new database based on the Document Library template and take a look at the design. It'll have a frameset, and on the left frame it'll have a Notes Outline.
Once you have your database setup like that, you can control what the user sees in that outline by creating hierarchical outline entries. You can link views, pages, and forms to your outline entries and that way you can have your 1. Reports\a. Quarterly Reports view showing next to your 1. Reports\b.No of Request Per Country form (report).
Even better, you can use different names. Since an Outline manages its order, you don't need to name your entries 1., 2., etc to get them to show in a certain order. You can name them whatever you like and rearrange them in the Outline design screen.

Resources