Task #2405 (closed)
Opened 9 years ago
Closed 9 years ago
Parameter defaults
| Reported by: | wmoore | Owned by: | jamoore |
|---|---|---|---|
| Priority: | minor | Milestone: | OMERO-Beta4.2 |
| Component: | General | Version: | n.a. |
| Keywords: | n.a. | Cc: | jburel |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | 0.0d |
| Sprint: | 2010-06-24 (12) |
Description (last modified by wmoore)
If I have a String parameter, I can specify the default like this:
scripts.String("Data_Type", default="Image")
but if I use a list I have to do
scripts.List("Channel_Colours", default=rstring("White"))
Unfortunately, this default is ignored by Insight.
The code below caused the script upload to fail with no validation exception:
scripts.List("Channel_Colours", default="White"),
Change History (10)
comment:1 Changed 9 years ago by wmoore
- Cc jburel added
- Description modified (diff)
comment:2 Changed 9 years ago by wmoore
comment:3 Changed 9 years ago by jmoore
Will, I'm actually a little surprised that you can even call default=rstring() since the actual value needs to be a list. But ok, let's call that a feature. We could add a call to "wrap" which in the case of a string would work, but not a long. Probably the best thing to do is "encourage" the use of List.ofType and then we could use that type to do the casting, i.e. List(default="foo").ofType(rstring) or similar)
comment:4 Changed 9 years ago by wmoore
Could do that. I've not bothered to specify the type of list parameters if they're stings, but it seems reasonable to do it.
But, this doesn't work any better just yet:
scripts.List("Channel_Colours", default="White", values=cOptions).ofType(rstring(""))
Still need to wrap
default=rstring("White")
comment:5 Changed 9 years ago by cxallan
- Sprint changed from 2010-05-13 (9) to 2010-05-27 (10)
comment:6 Changed 9 years ago by cxallan
- Sprint changed from 2010-05-27 (10) to 2010-06-10 (11)
comment:7 Changed 9 years ago by jburel
- Sprint changed from 2010-06-10 (11) to 2010-06-24 (12)
comment:8 Changed 9 years ago by jmoore
comment:9 Changed 9 years ago by jmoore
- Status changed from new to assigned
comment:10 Changed 9 years ago by jmoore
- Remaining Time set to 0
- Resolution set to fixed
- Status changed from assigned to closed
This is actually a bit of a problem, since Insight seems to ignore the default if it is wrapped in an rstring?
Or maybe Insight ignores defaults for lists of enums?