• [OpenKM 4.1] Remove E-Mail from search context

  • He we will discuss about how to make customization and improvement to the OpenKM source code.
He we will discuss about how to make customization and improvement to the OpenKM source code.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #5259  by blindrood
 
As topic says, I've been trying to remove E-Mail option from search context so users can't search through mails but don't know how to do it.
I tried many changes in SearchIn.java but with no positive results (in fact I had only been breaking code ;])
Can You help me do so?
 #5266  by jllort
 
Good new to you in version 5.0 show / hide panels, and actions are configurable, now I'm working on it ... in versino 5.0 what now you must do changing code is automatically done by configuration params.

Meanwhile this is the class that you must change:
SearchIn.java

Take a look at variable
Code: Select all
public ListBox context;
When variable is initalizaing
Code: Select all
context.addItem(Main.i18n("leftpanel.label.mail"),"");
Language refreshing
Code: Select all
public void langRefresh() 
Setting the context path
Code: Select all
public void setContextValue(String contextValue, int stackView)
 #5269  by blindrood
 
So I commented out
line 340
Code: Select all
context.addItem(Main.i18n("leftpanel.label.mail"),"");
line 740
Code: Select all
context.setItemText(PanelDefinition.NAVIGATOR_MAIL,Main.i18n("leftpanel.label.mail"));
and lines 1135-1137
Code: Select all
case PanelDefinition.NAVIGATOR_MAIL:
                 context.setValue(PanelDefinition.NAVIGATOR_MAIL,contextValue);
                 break;
Then while logging into OpenKM window showing startup progress stops at 'loading trash' statement
with no errors.
This what I meant when I was saying about code breaking :)
Image
 #5271  by jllort
 
probably some null pointer or similar during loading.

Edit Main.java

Show by default popupconsole and enable log ( is disabled by default too ). You'll see where's the error.

You can to make some Window.alert( in StartUp.java -> there's the loading sequence )
 #5280  by blindrood
 
I guess I found it
when startup init reaches loading trash
it initializes trashTree
which calls setContextValue with NAVIGATOR_TRASH as a Stackview
when switch statement there calls
Code: Select all
context.setValue(PanelDefinition.NAVIGATOR_TRASH,contextValue);
openkm throws IndexOutOfBound Exception null

following GWT javadoc of ListBox
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range
And now I get it :D
uncomenting
Code: Select all
context.addItem(Main.i18n("leftpanel.label.mail"),"");
caused decreasing trash item index in context by one causing this exception.
So I changed NAVIGATOR_TRASH value to 3
and OpenKM started <yay>
Now I'm looking for any code that this change breaks.
Thanks for pointing some ways of debugging
I have learnt a lot of gwt today :P
 #5281  by jllort
 
With OpenKM 5.0 we've upgraded to GWT 2.0.3 and it can debug directly from eclipse ( breakpoints etc... ) really more powerfull. OpenKM version 4.1 is still using GWT 1.5.3 and there're a lot of changes upgrading to GWT 2.X version ( deprecated listeners changed to handlers etc... )

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.