Customizing properties dialog screen in IBM Content Navigator - ibm-content-navigator

I need to develop a functionality in IBM Content Navigator where after search for an item, right click it-> Properties, I need to either:
1 - add a button in properties dialog screen that will call a service and open another dialog;
2 - or extend the Save button functionality to also call a service and open another dialog;
What's quickest way to achieve that ?

Have a look # ecm.widget.dialog.EditPropertiesDialog and onSave() method. This might help you to extend save button functionality.

You can add your customized code by using aspect before/after:
(choose either depending on your functionality)
aspect.after(ecm.widget.dialog.EditPropertiesDialog.prototype,"onSave", function(event){
......
});
aspect.before(ecm.widget.dialog.EditPropertiesDialog.prototype,"onSave", function(event){
......
});

Related

Can I change "OK" button style in Select Dialog to emphasized?

anyone know if sapui5 provide solution/function to change button style in select dialog? I've checked the SAPUI5 sdk but there is none for this solution.
If you are OK with using "private" properties then you can use _oOkButton property of SelectDialog or else you can use _getOkButton function which also is kind of "private" and returns ok button instance.
Just use the instance of the Select Dialog and get all buttons using the following methods. Select Dialog is a dialog only, you can use the methods of sap.m.Dialog
Let say you have the instance of the dialog as oSlectDialog then
oSlectDialog.getButtons() - will return all the Buttons in the footer. You can use loop them and give custom class accordingly.
var oBtns = oSlectDialog.getButtons()
for(var b in oBtns) {
var oBtn = oBtns[b];//You can check for button instance, if you want to add custom class differently.
oBtn.addStyleClass("YourCustomClass");
}
You can also use the sap.m.Dialog methods like oSlectDialog.getBeginButton(), oSlectDialog.getEndButton().
Since UI5 1.62.0, the primary action OK (later renamed to Select) is automatically emphasized if the theme is sap_fiori_3.
https://openui5.hana.ondemand.com/#/entity/sap.m.SelectDialog/sample/sap.m.sample.SelectDialog
If it's not urgent, I'd suggest to avoid relying on private methods/ properties, but update to the latest UI5 version and themes.
Update: and since 1.70 (commit:1f421b0), the button is automatically emphasized in other supported themes too, such as sap_belize, sap_belize_plus
Related Github issue: https://github.com/SAP/openui5/issues/2254

Leaflet layer control open only on click

Is there any way to open leaflet layer control only when clicked?
By default, it expands/collapse when on mouseover/mouseout. I want to open only on click.
You can use a bit of jQuery to get this done.
Set the 'collapsed' option to false and instead, create a button to show/hide the layer control.
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
jsFiddle:https://jsfiddle.net/jht7u28L/1/ (a basic example)
Stop propagation on mouse over solved it. I am using d3 here but It can be easily handled by plain javascript or by jQuery.
d3.select(".leaflet-control-layers-toggle").on("mouseover", function () {
//this will make sure that layer popup menu
//not opens when mouseover
d3.event.stopPropagation();
});

Custom button for toolbar Eclipse RCP Application

I am currently working on a web browser application using Eclipse e4.
I want to put on the toolbar a toggle button for saving my favorites url's.
I want it to be like in Google Chrome , a star which gets the yellow color when it's pressed(the link was added to favorites).
How can I do this?
Should I use for this the Application.e4xmi ?
You can use the Application.e4xmi if this is a tool bar for a Window or a Part. You would use a 'Handled Tool Item' in the tool bar.
The Application.e4xmi does not provide a way to set separate icons for the selected and normal states of a tool item so you will have to do this in the handler class. Something like:
#Execute
public void execute(MToolItem mitem)
{
if (mitem.isSelected())
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/selectedimage.png");
else
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/unselectedimage.png");
// TODO other code
}

Changing button icon of SplitApp master view

How can one change the default button icon of the SplitApp master view?
Let's say I want to use this icon instead of the default:
"sap-icon://filter"
I was trying setHomeIcon property of SplitApp but it did not work.
Here is jsbin example, which I found. It would be nice to change icon there. Thanks for any hint.
The icon you would like to customize belongs to the master button of the SplitContainer which is the base for the SplitApp.
SplitContainer does not provide an API for setting the masterButton icon. However you can register for the master button event and obtain the button there. This works only with the following conditions:
You need to prepend the view ID to the SplitApp control ID using this.createId("mySplitApp"). If you use XML views this is done automatically.
You rely on the naming of the button. If SAP decides to change the name this won't work.
The following event handler implementation will do the job:
oSplitApp.attachMasterButton(function(event) {
if (event.getParameter("show")) {
const button = this.byId(this.createId("mySplitApp-MasterBtn"));
if (button) {
button.setIcon("sap-icon://filter");
}
}
}, this);
The example can be found here.

Open Model on edit in list view

In backpack list view when I click in edit button then I get redirected to another page instead of I want model window where I edit and save the record. Also want for Add New.
How can I do that?
The system really isn't designed for that behaviour to be changed, but if you REALLY need it i guess you can create new files in your resources/views/vendor/backpack/crud. This will make Backpack use those views instead of the ones in the package. You can copy views from the package and change them to fit your need:
- list.blade.php would include edit.blade.php in a bootrap modal;
- buttons/edit.blade.php should trigger the right modal on click;
- edit.blade.php should submit the form with ajax instead and catch the errors, to show them inside the modal;
The same process needs to be repeated for the create.blade.php file.
It won't be easy...