Sonar Plugin editing the .erb file on the fly? - sonarqube

Is it possible to edit the widget.erb file on the fly without restarting the Sonar server? I am thinking it is no different than any other front end file, but since the plugin is not actually "exploded" there is no way to edit the file without opening the jar and editing it.
However if there was a way, it would allow designing the widget that much quicker!
thanks!

Indeed, it's possible to edit plugin web content on the fly. Please look at this page : http://docs.codehaus.org/display/SONAR/Extend+Web+Application.
You can either :
For widget : Edit the method RubyRailsWidget#getTemplatePath() in order to return the absolute path to the widget file, rather than the class path (See more in Widgets -> Development mode)
For web app : Edit the file war/sonar-server/WEB-INF/config/environment.rb and set the absolute path to your ruby application by replacing the property config.plugin_paths (See more in Applications -> Development mode)

Related

Events are disabled in codenameone

I have problem when I want to access events. I already copied the resource files (nativej2me.res) under src directory but still the events are disabled within my project.
Can anyone help me how to arrange the resources so it enables the vents..?
Thanks
Don't move that resource file. Its not the place for it.
I'm guessing you created a handcoded application where GUI builder events aren't supported. You need to create a GUI builder project when creating a new project.
That's a GUI builder project (notice the visual not manual in the brackets)
Just for the googlers out there:
Have a look in the file codenameone_settings.properties - in there you'll find the property userClassAbs=something/StateMachine.java
Its an absolute path and it was showing the wrong directory. After fixing this I was able to add Events in the Designer again.

Qooxdoo - how do i create a new theme and use it in the application?

I am quite new to qooxdoo and I need help in creating a custom theme for my application.
I copied the native Modern theme and modified some of its features, now my question is how do I add it as new theme to qooxdoo and how can I use it in my application?
any help or guidance would be greatly appreciated.
You don't need to copy it over, simply extending the theme would be good. If you created your app with the qooxdoo desktop skeleton using the create-application.py helper, you should already have a custom theme in place running and extending the modern theme. If not, you simply have to edit the config.json file which should be in your root project folder and search for a key named QXTHEME. The value of that key is a classname which specifies your theme. Change that to your custom theme class and rebuild the app to see the result.
Here are some further resources on how to work with themes: http://manual.qooxdoo.org/current/pages/desktop/ui_custom_themes.html
To add a bit to Martin's answer: You don't copy and modify theme code, you extend and override, much as with class code.
If you create an application skeleton with create-application.py, the default code structure under source/class already contains custom theme classes (under source/class//theme/*). The thing is those theme classes extend from the Modern theme without actually overriding anything, so you effectively get the Modern look and feel.
But you can then go ahead and flesh out those custom theme classes, with properties that suite your taste, thereby creating your own theme.
i found it very difficult to create a custom theme by extending one of the existing native themes (classic, modern... etc) without looking at the source code, also i don't want to mess up the original API's files by modifying them, so i did the following:
1- replaced files in my application's directory: myapplication/source/class/myapplication/theme/ with the files in /qooxdoo-directory/framework/source/class/qx/theme/modern/. replaced four files in total (Appearance.js, Decoration.js, Color.js and Font.js).
2- copied decoration directory from /qooxdoo-directory/framework/source/resource/qx/decoration/Modern to my application's directory: myapplication/source/recourse/myapplication/decoration.
3- copied icons directory from qooxdoo-directory/framework/source/resource/qx/icon/Tango to my application's directory myapplication/source/resource/myapplication/icon.
4- copied Tango.js from qooxdoo-directory/framework/source/class/qx/theme/icon/Tango.js to my application's directory myapplication/source/class/myapplication/theme/icon/Icon.js.
5- edited the meta file Themes.js and changed it to:
qx.Theme.define("myapplication.theme.Theme",
{
meta :
{
color : myapplication.theme.Color,
decoration : myapplication.theme.Decoration,
font : myapplication.theme.Font,
icon : myapplication.theme.icon.Icon,
appearance : myapplication.theme.Appearance
}
});
6- edited Icon.js file (which i copied from Tango.js in step 4) and changed it to:
qx.Theme.define("myapplication.theme.icon.Icon",
{
title : "myIcons",
aliases : {
"icon" : "myapplication/icon"
}
});
7- edited Decoration.js, Appearance.js, Color.js and Font.js in my application's theme directory and changed the classes' namespaces from:
qx.Theme.define("qx.theme.modern.<file's name>",
to
qx.Theme.define("myapplication.theme.<file's name>",
8- corrected assets paths in Decoration.js and Appearance.js from the original path qx/decoration/Modern or qx/icon/Tango to the one relevant to my appliaction myapplication/decoration and myapplication/icon, for example:
#asset(qx/decoration/Modern/toolbar/toolbar-part.gif)
changed to
#asset(myapplication/decoration/toolbar/toolbar-part.gif)
ps: the relative path in an application is application-name/source/resource, so you can refer to any directory in this folder by application-name/folder-name.
9- likewise in step 8 i changed aliases in decoration.js to:
aliases : {
decoration : "myapplication/decoration"
},
10 - ran generate.py file in myapplication/source.
and done, now i can change anything i want without crashing the API :)

How change variables before rendering in phpfox?

Hi I want to edit some variables before Phpfox rendering them into output without changing main files to keep theme updateable. For example I want to edit the value of location or birthday before they are rendered. What should I do exactly?
The best way to make edits without disrupting any core files is with the use of plugin hooks. You could create your own module specifically for creating plugin files.
Here is a starter guide: http://phpfox.org/kb/article/144/creating-your-first-add-on/plugins/

Changing Where CKEditor Looks for Images

I am wondering if there is some way to change where CKEditor looks for images. Right now it uses the location of the web page containing the editor as the root directory but I would like to write a javascript function that can change this directory to any arbitrary path passed to the function.
The bigger picture for this is that I'd like to extend the functionality of CKEditor to be able to save the source it creates to whatever location is picked by the user. I've already implemented getting the source and saving it using wxWidgets but am having trouble getting CKEditor to change its working directory so that images can be included from the directory the user picks.
I've tried using some of the properties like baseDir, basePath, and baseHref to make this possible but as far as I can tell none of them quite do what I'm looking for.
So the process would be:
(1) The user picks a directory where the source will be saved
(2) The user creates a page using CKEditor where images from the directory chosen can be included AND DISPLAYED in CKEditor
(3) The user saves the source of their page to the chosen directory (the source saved here should use the relative path to the images because the source is now located in the same directory as the images it includes)
I realize this is a rather unconventional use of CKEditor but if someone might be able to kick me in the right direction to making this happen, I'd really appreciate it.
EDIT:
So after a little experimenting and changing some backslashes to regular slashes, it looks like the baseHref attribute does what I'd like. I've still not been able to change its value at runtime though as I would like. Does anybody know if this is possible with CKEditor? I'd still like to have a javascript function that I can pass a path to and have it change this baseHref value. Right now I have set its value in config.js.
If this isn't possible, I know you can read and write the source in and out of the editor. So I would like to resort to reading and storing the source from the editor, reloading CKEditor with a new config.baseHref, and then writing the source back into the editor. Does anyone know if the CKEditor api provides functionality to reload its configuration?
Thanks.
I don't expect too many people will be trying to do what I was doing here since CKEditor is usually hosted on a server somewhere, but in case someone finds it helpful, here's what I ended up doing.
As I mentioned in the edit to my question, modifying the baseHref gave me the functionality of prepending the image filename with the directory path leading to it. I wasn't able to find a way to modify it while the editor was running so I ended up telling CKEditor to load an external configuration file each time it started with the line
config.customConfig = 'C:/Users/kenwood/Desktop/MarkCreator2/ckeditor/custom_config.js';
Then I used C++ to write new contents to custom_config.js any time I wanted to switch directories.
Unfortunately this method meant I had to read the contents out of the editor, refresh the page, and then write the editor contents back in any time I wanted to change directories. This was adequate for what I needed though.

custom components in loadUI

How can I add custom components into loadUI please?
I want to download the HTTP Runner component. In the zip file, there is a .png and groovy script file.
Thanks in advance
Extract the contents of the zip file into the script-components
directory in your loadUI installation, and the component should show
up in the Component toolbar.
I tried this for the custom HTTP runner component, and it immediately showed up in the runners toolbar on the LHS (didn't even have to restart loadUI).
source: http://htpwww.eviware.com/forum/viewtopic.php?f=10&t=11220

Resources