runtype edit problem

Hello,

I'm developing a RunType plugin. Everything was ok, but I have a issue that I don't know how to solve.

I have a property in the main-config.xml file, which I am able to read and write. I'm using getDefaultRunnerProperties to add the property and to use in my editRunnerParams.jsp.
The problem is that after creating the build step, when I'm trying to edit again, the getDefaultRunnerProperties method it's not called and my value it's not sent to the jsp file.

Does someone know how can I pass this value to my edit jsp file, or how can I get  a spring bean from JSP? Which is the best way to pass parameters?

Thanks,
Mark

5 comments
Comment actions Permalink

Hi Mark,

Can you pleaese detail a bit?

getDefaultRunnerProperties is meant to provide default properties. That is, deafult to populate the values on runner settings creation.
Why do you want to use it on editing a build step?

What is your current task you are trying to solve?

Just in case, you can use some of the available plugins such as PowerShell as examples.

0
Comment actions Permalink

Ok, I'll try to be more specific..

Looking at the PowerShell example, int the PowerShellRunType.java , method getDefaultRunnerProperties() you have the following line:
map.put(RUNNER_BITNESS, PowerShellBitness.x86.toString());

This parameter is available in the editPowerShell.jsp. This can be used to initialize different fields with default values.
But, this field is only available when you first add the build step, after you save it and edit again you will not have this value available.

This is my problem, because I used to put into the map a few fields that are dynamic (cannot be in a simple bean).

What other ways to send params I have? (beside a simple bean which is not ok).

Hope that it more clear now

Thanks

0
Comment actions Permalink

Mark,

Do you mean you need to pass some data from the code to JSP to be used when redering runner settings editing page?

There is no easy way to do that now, but I can give you an example if that is what you need.

Could you describe the original functionality you want to get for a user?

0
Comment actions Permalink

Do you mean you need to pass some data from the code to JSP to be used when redering runner settings editing page?
Yes, this is exactly what I want

There is no easy way to do that now, but I can give you an example if that is what you need.
Yes, please, this will be great


Could you describe the original functionality you want to get for a user?


Basically, it's a plugin that based on a hash key, access an external server, loads data, and starts some process. This hash key it's the problem, since all the request to the external server are based on this.


Also, do you know if it's possible to create an extension for the Administration -> Server-wide Settings page? In this extension I want to put just one edit field.
I have a property that is general for all projects(a hash key), and should be accesible for edit&view only by administrator users.

Thanks
0
Comment actions Permalink

Mark,


>> There is no easy way to do that now, but I can give you an example if that is what you need.
> Yes, please, this will be great

A possible approach is mentioned in the comment.


> Basically, it's a plugin that based on a hash key, access an external server, loads data, and starts some process. This hash key it's the problem, since all the request to the external server are based on this.

Thank you for the description. A note, though: from a general perspective, it seems not necessary to put the hash into the page if it is then processes on the server-side.



> Also, do you know if it's possible to create an extension for the Administration -> Server-wide Settings page? In this extension I want to put just one edit field.
> I have a property that is general for all projects(a hash key), and should be accesible for edit&view only by administrator users.

Please note that TeamCity 7.x has different Administration UI structure, you seem to be using earlier version of TeamCity.

Seems, you can use http://javadoc.jetbrains.net/teamcity/openapi/current/jetbrains/buildServer/web/openapi/PlaceId.html#ADMIN_SERVER_CONFIGURATION
(see example in the profioling plugin sources)
However, I'd consider using http://javadoc.jetbrains.net/teamcity/openapi/current/jetbrains/buildServer/controllers/admin/AdminPage.html

0

Please sign in to leave a comment.