powered by Jive Software

Customization of spark

I am looking to remove some menu options from spark (for example the preferences menu under the Spark menu). Also, I got the latest version VIA SVN. I have disabled the plugin installtion capability. I am using fastpath on my server. When I ant release and run the build from the startup.bat file, I am do not get the fastpath tab. Is there a reason for this, like it is unavailable unless fully compiled? I do have some plugins disabled, but not Fastpath. Any help on how to edit menu options would be greatly appreciated!!

Plugins has to be build separately (or maybe together with the Spark). If i need to build a new version of some plugin, i usually go to that plugin (in NetBeans), right click its build.xml and Run target > jar. Then i compile new Spark project. Well, i’m not a developer, so this is what i have figured out myself. Have to be a better way to build everything together, but i don’t know how.

I’ve never had any luck compling spark in NetBeans. It always errors where as ant seems to always work…But i’ll try again in NetBeans to see what happens. I’ll post once I get there with it. Thanks

Error Received when I try to do what you said:

clean:

Deleting directory C:\Projects\spark\src\plugins\fastpath\build\classes

resources:

Copying 11 files to C:\Projects\spark\src\plugins\fastpath\build\classes

compile:

Compiling 43 source files to C:\Projects\spark\src\plugins\fastpath\build\classes

C:\Projects\spark\src\plugins\fastpath\build\build.xml:51: C:\Projects\spark\target\build\lib not found.

BUILD FAILED (total time: 0 seconds)

EDIT:

I’m newish to JAVA but from what I can tell its saying that a file in the lib folder is missing…yet when I the lib folder exists…but no files in it, just one folder, “dist”.

Message was edited by: Brian Baum Jr.

Try right clicking the Spark project, go to Properties, then to Libraries, press the “Add JAR/Folder” button and add …Spark/build/lib folder.

I added the spark/build/lib folder when I first tried, I also tried adding the src/plugins/fastpath/build/lib folder this time. Still receive the same error.

After a crazy Idea, I created a new netbeans project after running ant release on the thing. low and behold FastPath now works after I did what wroot said and re ran ant release on the project. Now, the last thing I have left is removing the preferences option from the Spark menu.

found where to edit menu items in the spark\src\java\org\jivesoftware\MainWindow.java file.

In here you can simply // out whatever sub menu items you don’t want to show!

EDIT (added to post):

Thanks to WROOT for pointing me on the right path! Now I have all the plugins working I need and they are embeded into the spark system…I found while compiling that the following did not complie correctly for me however (simply redid my netbeans project and removed them from the plugins folder before i redid it):

apple, battleships, growl, jingle, linux, reversi, roar, sip (gave a few warnings but did compile), and tictactoe

Granted these not working could be from a noob working with them, but just throwing it out there for you guys to see.

Message was edited by: Brian Baum Jr.

HI,

Spark is partially customizable with respect to what menu items to show/hide.

There are properties values in default.properties that accomplish this

For instance the “Spark/Exit” menu item can be hidden or shown given the value of DISABLE_EXIT property

If you look into spark’s default.properties you will see:

If true, Spark cannot shut down

users wont be able to shut down Spark

DISABLE_EXIT =

In MainWindow.java we have:

if (!Default.getBoolean(“DISABLE_EXIT”)) {

connectMenu.add(exitMenuItem);

}

So if you modify default.properties and put DISABLE_EXIT=true, the Exit menu item will not show up.

More than this you don’t even have to touch Spark - in latest Spark code there is a mechanism that enables you to put a default.properties in your spark plugin and put there : DISABLE_EXIT=true, and the exit menu will be hidden…

See for reference: http://issues.igniterealtime.org/browse/SPARK-1313

Unfortunatelly there is no such property to hide the Preferences menu item - so patch is welcomed to make this menu item appearance customizable as well…

Thanks,

Mircea

If you open the MainWindow.Java in a Java Editor (ie jEdit) and put // infront of the following lines, it will cause them not to show up when you compile and build spark:

disables the Spark/Plugins menu item

mainWindowBar.add(pluginsMenu);

private final JMenu pluginsMenu = new JMenu();
ResourceUtils.resButton(pluginsMenu, Res.getString(“menuitem.plugins”));

disables the Spar/Preference menu item

connectMenu.add(preferenceMenuItem)

disables the Spark/Always on top checkbox menu item

connectMenu.add(alwaysOnTopItem);

These are just a few that I disabled…granted this is a work around, but it did the trick!

I have pinged Mircea to check your thread, but you have found the solution faster Though i like default.properties approach better and hopefully in the future it would be easier to create a customized Spark version.

Mircea, but what about users unloading plugins? Then a plugin with some restrictions will not load. Unless you disable the Plugins menu too

Well, I see that the presence of the plugin menu itself is not customizable, but you can restrict some functionalities through properties:

from default.properties:

#http://www.igniterealtime.org/updater/plugins.jsp

Disable Installing of Plugins

set true if you want to disable installing of Plugins

INSTALL_PLUGINS_DISABLED =

Disable deleting of Plugins

set true if you want to disable deinstalling of Plugins

DEINSTALL_PLUGINS_DISABLED =

Yes, but is there a way that we could add into the default.properties file to disable particular menu options from being shown? Like we have the ability to add in those lines to disable the plugin from install/removal but the menu option still shows. Like in my example, when i commented out those lines, it completely removed the option from being shown…how could it be tied into the default.properties file for each menu option/menu suboption? To go even further, for each of the options when you right click on a particular user?

For some of the menu options there are properties key -values in default.properties (I gave an example in a previous comment for the Exit menu option - for this one, Spark has DISABLE_EXIT property. And there are other properties to customize the appearance of other menus/buttons:

ACCOUNT_DISABLED =

INSTALL_PLUGINS_DISABLED =

DEINSTALL_PLUGINS_DISABLED =

HELP_USER_GUIDE_DISABLED =

HELP_FORUM_DISABLED =

DISABLE_UPDATES=

CHANGE_PASSWORD_DISABLED=

)

But for your particular case (the preferences menu or the Plugins menu item) there is no property to customize their appearance… Thats why I suggested that a patch would be welcomed

Mircea

I will be hapy to work on a patch, but as I am new to java, this may take a while. Also since we are here hashing things out about Spark and Fastpath, is there a way to display the avatar to a remote person (basically in a nutshell, I will have agents helping clients VIA fastpath and spark…I would like to client to see the agents picture as they are chatting). Thanks!

And if I want to remove the button “Start a Chat”?

1 Like

Hi all,

I also had a requirement from management to disable several menu items in the Spark GUI. I recently modified and re-compiled the program to allow for the following new settings:

HIDE_LOGIN_AS_INVISIBLE = false

DISABLE_PREFERENCES_MENU_ITEM = false

DISABLE_PRESENCE_STATUS_BAR = false

DISABLE_OPEN_HIDE_STATUS_IN_SYSTRAY = false

DISABLE_BROADCAST_MENU_ITEM = false

DISABLE_AVATAR_TAB = false

DISABLE_PLUGINS_MENU_ITEM = false

I submitted pull request #232 and am awaiting a response from the repo maintainers. Hope these new settings will help other administrators!

Regards,

Michael

Hi, Michael. I saw your PR. In a few days i will review and merge it. Thanks.

Although i wonder who would need hiding Open/Hide menus, especially when one can achieve this by just clicking on the icon

Also, it would be best to hide the whole Presence GUI, not just make it not clickable (so we won’t get angry users posting here that Spark is not working as supposed ).

Hi Wroot,

Thanks for taking my PR into consideration. I just wanted to clarify some points you brought up:

The use of the Open/Hide popup in the taskbar (by right-clicking on it) is redundant since the Spark window can easily be made visible or hidden by simply left-clicking once on its system tray icon. Left-clicking on it again will make it disappear.

As far as the “Presence” menu item (under “File”), the setting does in fact take that item off the list. If you’re referring to the “Presence” status bar - I made it so that the user’s current presence is shown, but it cannot be changed from a dropdown list.

Let me know if there is anything else you’d like for me to adjust. I’m just beginning my journey into Java, so please take it easy on me!

Regards,

Michael

Hi Wroot,

Sorry, I confused the “Preference” menu item with the “Presence” status bar in my explanation. Please disregard. It is late here and I’ve been in front of this computer screen for over 12 hours now. Time for sleep!

I will look into adding an option to totally hide the “Presence” status bar if people really want that. Thanks again!

Regards,

Michael