is it possible to use smart image in multi-composite field? - dialog

I tried using smart image in multi composite field. In that the images are getting persisted, the remaining fields in the multi composite fields are not getting persisted. when i edited the dialog for the first time the values are getting stored on the node. when i edit the dialog next time it is showing me empty fields for the fields other than smart image.

This won't work. SmartImage and SmartFile have some restrictions to them. And there are two different versions: SmartImage and SmartFile vs. Html5SmartImage and Html5SmartFile. Depending on your actual Version of CQ it is even only possible to have the smartimage as a separate tab without any other fields. On top of that the behaviour for the different browser and versions together with the configuration of your SmartImage have different outcomes in JCR. This is even true for AEM 5.6.1 and the Html5 versions of the the xtype.
I can't post the full solution (as the code is not mine) but give some pointers how you could achieve your requirement:
Write your own Widget that replaces the multifield xtype. The author called it genericmultifield and what it does is to open an additional configurable dialog for each item. In this dialog you have the full controll again. It stores each item as a separate node below your resource from where you open your main dialog.
Though you need good ExtJs knowledge to achieve this and considering AEM 6, with a complete new Touch UI I am not sure if it is wise to do so. I didn't have time to check out AEM6, but maybe they already have something like this in their new UI.

Related

View will show all list updated form every time changes made

I'm new with lotus notes. Basically, I have a form. I want to create a situation where when I edit the form, that form will not be overwritten but it will automatically create a new form with an updated form. But when I open the new updated form, we can see all list of history from the old form. I can't think of any way to create it. Any suggestion would help me. Thanks!
First of all: you need to know the difference between FORM and DOCUMENT.
The FORM is the design element in designer that you create and that is used to create and modify DOCUMENTS.
A DOCUMENT is a set of item - value pairs stored in the database. The items are based on the FORM it is created with.
If I understand you correctly, you want to create a new DOCUMENT on every save but keep the old DOCUMENT at the same time. There is a function called "Version Tracking" that allows this.
Read this documentation about how to use versioning. Here is a short version:
Open the form.
Choose Design - Form Properties.
On the Form Info tab, select None or one of the following versioning methods:
New versions become responses
Prior versions become responses
New versions become siblings

Conditionally Enable Custom Converter based on a Users Input

I would like to conditionally run a custom converter. I have an XPages that handles editing and new data on the same page. The user selected a radio button to edit or create a new item.
The input fields are shared between these two functions. Upon page load I do not know what the user will do so I cannot use the "Loaded" property of the converter.
I need to format the data in this format '$900,000'. Note that there is no cents in my required format.
The built in converter for numbers or currency fails me because no matter what I do, it always add the cents. I assume that this is a bug in XPages. It doesn't matter if I say "Integer Only" or set the Maximum Fraction Digits to zero. The cents do not go away.
I have a custom converter that works fine for me, but only works when it is recalculated once, and fails when recalculated. I have tried setting the partial refresh updates to "Do not validate or update data" and this works, but breaks other parts of the page where I needs the updates to be enabled.
This application is soon to be deployed and it is too late for me to re-engineer the whole page structure to solve this issue -- too many moving parts. All I need to do to please the testers it to get rid of the cents (xxxx.00) that are added to the value, and still have everything else work.
My problem is singular, but my questions are tri-fold. How can I:
Get the built-in currency converter to remove cents the way it should? Or
Get the custom converter to be enabled ONLY based on a user-entered value? Or
Help me think of a different approach to solving this issue?
Steve, I have really fought a battle with converters as another problem is that they are all run prior to validation - and as such error messages are not necessarily shown in sequential order.
Therefore, I ended up using validators (also for the work of the converters). And on top of that I use "binding" of the components (not the values) to easily access other fields on the same page. This allows for conditional checks/logic. If you have not tried component binding, then there is a great introduction by Tim Tripcony.
/John
A couple ways to do this, One would be to do the conditionally checking of user in the custom converter. Another approach would be to use a PhaseListener and in RenderResponse Phase get the Component and set the Converter on the component to null when you don't need it on the component. I typically don't use converter though if its just the display of the number, just if I actually need the value converted. I would use something like a display Mask I've recently used a jquery plugin called maskMoney that worked well for a similar problem.
I assume your converter is on an editable field, because otherwise it won't fail on submitting data.
The problem sounds to be timing. The converter has to run during page load, in order to convert the Number value stored in the database to a String value required by the browser. So some default needs to be set, which presumably is to connect it.
If you're then wanting to change the display option based on input, you've got to do a partial refresh after the input, in order to recalculated whether cents should appear.
Once the inputted value is passed back from the browser to the underlying component tree, you can calculate accordingly - providing your converter knows what to interact with. The process dugint he partial refresh is to restore the component tree, apply the request values (store the String value from the browser into the submittedValue property of each component), process any converters or validators, then update the component tree. So when the converter runs, the radio button's value property isn't set, so it works on the last refresh's setting - the default.
By choosing "Do not validate or update data" then you're saying don't bother writing back any inputted entries from the browser into the component tree. So I'm sure you can that means the converter will know nothing about what's been input.
John's suggestion on binding is a good one, but remember you'll be needing the submittedValue property of the relevant component. For a radio button, I'm not 100% sure what that will be, but you should be able to print it out.
The mask approach may work. Someone else used that recently to make integers work right.
The other option is to look at the Extension Library's Dojo Number Validation Text Box, which has a javaType property and a more flexible set of converters. That may well allow you to avoid cents. If it does and you don't want the Dojo look and feel, it's converter should give some ideas on what your converter needs to do to remove cents.
I could not get any of the answers above to work, so I cloned the text box. I made one show up for "Edit", and one show up for "New". I kept everything the same, but only added the custom converter to the one that shows for "Edit".
Thanks again for all your help. The XPages community rocks!

How to create a View with replication conflicts

I wish to create a view showing a number of fields from notes documents with replication or save conflicts. So far I have managed to create a basic view with a column for the document ID (Contract ID) then the next column states "Replication or Save Conflicts" but I don't seem to able to either get rid of the replocation or save conflcits column or add new columns to show additional fields from the document. Is there a way I can do this? I want to be able to show the view in XPages. Here is the View selection formula I am using;
SELECT #IsAvailable($Conflict)
Conflicts are not displayed good in views. here are a few alternative tips to deal with conflicts that might give you an idea or two :-)
Create a categorized column with the value of the field $ConflictItems in the view you have, then you will see which item is causing the conflict and can take action to prevent it.
When you open a conflict you can use the action menu "View Parent" to compare the parent and the conflict
Ytra ScanEZ is a great tool for finding and resolving conflicts. it is also possible to create a script that will compare the documents and present a diff list.
You can create an XPage to display your conflicts (and parents). The web is more dynamic as it allow you to layout your data in the way you want and is not restricted to the way view in Notes works. This kind of xpage can be displayed in Notes client or Web browser
Use XPages power. Get all documents from the view with your selection formula. But don't try to show any column value and get fields directly from back-end document you get from view entry entry.getDocument().
Sure, it has some performance impact, but for (hopefully) small amount of replication conflict it's nothing serious.

Can't create graph from node/edge collections in ArangoDB 2.2.0

Last week was released ArangoDB 2.2.0 with many nice changes. I want to refactor some AQL graph queries since the API has changed from 2.x to 2.2.x and many methods are now deprecated. The issue is that I can't create a graph from my node/edge collections from the UI, I'm getting the following error:
Sorry your graph seems to be empty
Having a look at the logs there is no error.
Any clues?
EDIT:
I include the UI behaviour I commented:
By default, from/to collections do not show up:
When clicking the add button or near to it, from/to collections fields show up. It's not clear to me I should do it to be able to set up the edge definition.
I just found out the issue, a UI related one. When specifying the edge definitions, only "Edge defintions" field is displayed but not "fromCollections" and "toCollections" fields. I was a bit confused about it as well, since in the docs I noticed these concepts (in 2.1.2 only edges collection name was necessary). By clicking in the add button (or around it), these fields show up and everything works as expected when filling them in.
The graph viewer expects a graph to contain at least one vertex.
This message indicates, that your graph does not contain any data. Please make sure that your vertex collections contain at least one document.
I am bit confused by your description.
In all versions below 2.2 we offered a dialog to configure your graph viewer before actually showing it (there you could select a vertex and an edge collection). Are you using a bookmarked version of this page?
It will not work any more.
If this is the case, please use the normal graphs tab from the menu and create a new graph where you reference the collections you already have.
If this is not the case the answer above is correct.

Create domino view dynamically in XPages

I want to know if I can click a button in my XPage and dynamically create a Domino View and then show it in a panel control on the same page. The reason I want to do this is because I have a categorized view and I don't want to lose category data by using full text search. So I am thinking of creating a new view dynamically and pass my search parameters, like end date or start date, into the view selection formula.
Is it possible? Any other alternative solution is also welcome.
yes you can, but you don't want to. A Domino view takes space in the database and quite some time for its first use. So you end up with a lot of views taking space and the need to adjust database space after removal. Your response times will suck big time.
Categories as shown in Notes views are no web interaction pattern, so you might want to solve a problem that actually shouldn't exist.
The preferred method for Domino application is navigation / drill down over search. But you could do a FTSearch where you add your category to the search parameters and render your results in a repeat control instead of a view control. There you have more control over the look and feel.
Whether or not it's the best solution, the answer to the immediate question about creating a view on the fly is yes: the Database class has a couple "createView" methods to allow you to create a new view, either entirely from scratch or based on a named other view. From there, you can use the "setSelectionFormula" and "createColumn" methods in the created View to build what you want. You can't do EVERYTHING with those methods, but it may be enough.
One problem you'd likely run into is ACL access: you'll need Designer rights to the database, which a normal user most likely wouldn't have. If you use the sessionAsSigner object to fetch a signer version of the DB (say, "var signerDB = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath())"), you can work from there. Off the top of my head, I don't remember if you will also have to up the "Maximum Internet access" setting on the last tab of the ACL to Designer as well, but you may.
I am assuming that you are referring to the problem that exists when you choose the documents based on the category. This is something that I find highly annoying and I wish that it was possible to turn this on and off. It makes sense for embedded views, but not for much else.
What I did to solve this was to include the category value in the next column. In this way that text could still be seen, even if it was a flat view.
Alternatively, you could also look into using a repeater control and create your own way of presenting the information. This would be used instead of a (Dynamic)ViewPanel control. You could then present the information any way you wanted as long as it is returned in the viewrow set.
Happy Programming!

Resources