Sectioned view section

76 views
Skip to first unread message

Łukasz Tasz

unread,
Jan 20, 2015, 3:58:52 AM1/20/15
to jenkin...@googlegroups.com
Hi All!!

I have a question, since you about view-section-plugin.

I would like to create list-view-section in a automated way - not
using gui, just from script console,
so far so good:

d1e28=new SectionedView("test section")
d1e28.initSections()
d1e35=new ListViewSection("STATUS", SectionedViewSection.Width.
FULL,
SectionedViewSection.Positioning.CENTER)

I have sectioned view, at least one section but I don't have regex...
//d1e35.setIncludeRegex("^dupa123")

is not avaliable - since SectionedViewSection dont extend ListView,
I'm not java expert, but as I see ListViewSection has inside
DesctriptorImpl which extends SectionedViewSectionDescriptor which in
constructor reads regex from "magic stapler" (maybe only for me :D )

Do you have any clue how I should proceed? should I implement
sectionedViewSectionDescriptor constructor which takes not "stapler"
but regex? Unfortunately this plugin is only gui oriented - at least
what I see...

thanks in advance & regards
Lukasz

Robert Sandell

unread,
Jan 20, 2015, 7:08:19 AM1/20/15
to jenkin...@googlegroups.com
I think you can set the fields directly

def regexp = "^dupa123"
d1e35.includeRegex = regexp
d1e35.includePattern = Pattern.compile(regexp)

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/2b5d54c5-2a01-49b0-a913-579eed3a0a77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Łukasz Tasz

unread,
Jan 20, 2015, 7:16:29 AM1/20/15
to jenkin...@googlegroups.com
Hi Robert,

this is what I tried, but then it claims that includeRegex is readOnly...

SectionedViewSection has no setter, and field includeRegex is defined as:
String includeRegex;
public String includeRegex;

is fixing issue, would be nice to have it also in official plugin.

Now I'm strugling with columns... descriptor creates column with line:

section.columns.rebuildHetero(req, formData,
Hudson.getInstance().<ListViewColumn,Descriptor<ListViewColumn>>getDescriptorList(ListViewColumn.class),
"columns");

I'm trying with:
d1e35.columns = new
DescribableList<ListViewColumn,Descriptor<ListViewColumn>>(Saveable.NOOP);
d1e35.columns.add(hudson.model.Hudson.instance.<ListViewColumn,Descriptor<ListViewColumn>>getDescriptorList(hudson.views.JobColumn.class))

but getDescriptorList returns empty list... diging :)
thanks a lot for your help!
br
L.
Łukasz Tasz
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS06dh50dLWKW-JygSS2BMXwLm0-X%2By0-qnQ6u9-ua7h-g%40mail.gmail.com.

Łukasz Tasz

unread,
Jan 20, 2015, 7:41:40 AM1/20/15
to jenkin...@googlegroups.com
ok went throu!

instead of:
d1e35.columns.add(hudson.
model.Hudson.instance.<ListViewColumn,Descriptor<ListViewColumn>>getDescriptorList(hudson.views.JobColumn.class))
it's enough to:

d1e35.columns.add(new hudson.views.JobColumn)

Guys, do you know whom we can trigger to make includeRegex field
public in sectionedView plugin?

regards
L.
Łukasz Tasz

Robert Sandell

unread,
Jan 21, 2015, 4:46:07 AM1/21/15
to jenkin...@googlegroups.com
So try;

def regexp = "^dupa123"
d1e35.@includeRegex = regexp
d1e35.@includePattern = Pattern.compile(regexp)


For more options, visit https://groups.google.com/d/optout.

Łukasz Tasz

unread,
Jan 21, 2015, 5:51:58 AM1/21/15
to jenkin...@googlegroups.com
Hi,

tried, does not work, it I'm touching includeRegex, jenkins claims
that I'm changing read-only field, if @... claims not such property.
would be realy nice to find something which does not require own
plugin changes.. maitenance is then a hell....

thanks in advance
L.

Łukasz Tasz
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS1mLCmg-1C3Kyi7hVNOf1djCZ8HF7x8cfLb-yjiF9SFiw%40mail.gmail.com.

Robert Sandell

unread,
Jan 21, 2015, 6:49:10 AM1/21/15
to jenkin...@googlegroups.com
Ok, so you'll need to look at the code for the version of the plugin you are running.


For more options, visit https://groups.google.com/d/optout.

Łukasz Tasz

unread,
Jan 21, 2015, 7:33:43 AM1/21/15
to jenkin...@googlegroups.com
I"m using and testing latest version with code:

private String name;
/**
* Include regex string.
*/
String includeRegex;
/**
* Compiled include pattern from the includeRegex string.
*/
transient Pattern includePattern;

includePattern I don't need to touch, since readResolve() will do
this, all we(I) need is seter for includeRegex, or possiblility to set
this.


with best regards
Lukasz
Łukasz Tasz
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3doTSXO3MrmBGDq3AVUTkA747CkPDZLroRC1%2BzEvHVAg%40mail.gmail.com.

Łukasz Tasz

unread,
Feb 2, 2015, 4:56:36 AM2/2/15
to jenkin...@googlegroups.com
Hi Guys, any possiblilities to make field includeRegex public?

regards
Lukasz
Łukasz Tasz

Daniel Beck

unread,
Feb 2, 2015, 6:30:50 AM2/2/15
to jenkin...@googlegroups.com
It has public getters and setters (since 1.526). The setter code will also show you why accessing the field directly would be a horrible idea.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAGRr-NhdQ9mG1gF_EzqqFNaCBrLHD1AjiW_MzdXXX4JV%3DVsPCg%40mail.gmail.com.

Daniel Beck

unread,
Feb 2, 2015, 6:32:52 AM2/2/15
to jenkin...@googlegroups.com
Sorry about that, only now saw the earlier discussion. Would probably need to extend Sectioned View.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/10FC5C18-001F-471C-A269-AACBF4B002DA%40beckweb.net.

Łukasz Tasz

unread,
Feb 3, 2015, 4:30:09 AM2/3/15
to jenkin...@googlegroups.com
yep extension is like adding Public in front of includeRegex field...

with best regards
Lukasz
Łukasz Tasz


> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/3FE96E2F-3C79-46FE-BE7E-1CDDBEFC1826%40beckweb.net.

Łukasz Tasz

unread,
Feb 12, 2015, 10:45:16 AM2/12/15
to jenkin...@googlegroups.com
Hi Guys,

sorry for bothering you,
is it really a big issue to arrange releasing of this simple change?
SectionedListView is missing setter of include regex that is kind of
equivalent in Jenkins ListView,

Can I commit such a change?


with best regards
Lukasz

Łukasz Tasz


Łukasz Tasz

unread,
Feb 20, 2015, 2:47:06 AM2/20/15
to jenkin...@googlegroups.com
looks like /dev/null.... pity :|

Łukasz Tasz
Reply all
Reply to author
Forward
0 new messages