Page 1 of 1

[OpenKM 4.1] Remove E-Mail from search context

PostPosted:Fri Jun 04, 2010 3:11 pm
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?

Re: [OpenKM 4.1] Remove E-Mail from search context

PostPosted:Sat Jun 05, 2010 9:50 am
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)

Re: [OpenKM 4.1] Remove E-Mail from search context

PostPosted:Sat Jun 05, 2010 10:28 am
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

Re: [OpenKM 4.1] Remove E-Mail from search context

PostPosted:Sat Jun 05, 2010 12:50 pm
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 )

Re: [OpenKM 4.1] Remove E-Mail from search context

PostPosted:Sat Jun 05, 2010 9:04 pm
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

Re: [OpenKM 4.1] Remove E-Mail from search context

PostPosted:Sat Jun 05, 2010 10:21 pm
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... )