poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <apa...@gagravarr.org>
Subject Re: Evaluating expressions outside a cell value context
Date Fri, 27 Jan 2017 11:17:56 GMT
On Fri, 27 Jan 2017, Greg Woolsey wrote:
> This can be done today by accessing the evaluate* package-scoped methods in
> o.a.p.ss.formula.WorkbookEvaluator from a class defined in that package.
> This requires some understanding of formula parsing and the resulting Ptg
> array, and uses a method explicitly noted to not be for public use.
> A general-purpose public method would look something like the other
> evaluate* methods:
> public ValueEval evaluate(String formula, CellReference ref, FormulaType
> formulaType) {

We have some evaluation related interfaces, maybe we could put one of 
those onto the Conditional Formatting and Data Validation classes, then 
add a evaluate method on WorkbookEvaluator based on that? (Add / expose)

> However, we may also want a more semantic way to handle evaluating data
> validations and conditional formatting.  Using them has several
> complexities and wrinkles that make it hard to do right in all cases

I'd lean towards adding ConditionalFormattingEvaluator and 
DataValidationEvaluator classes, which do the hard work of working out 
what applies, which of two competing things win etc. Put user-facing 
methods on those. Have those delegate down to the new WorkbookEvaluator to 
check if a given formula is true / false / etc

> This is definitely a candidate for a branch/discuss/refine/merge workflow,
> which I'm willing to pursue.  I haven't done SVN branches and merges in
> about 7 years, but how bad can it be? :D

You can always branch it in github if needed!

> One wrinkle is that I've seen the Vaadin code that does the conditional
> formatting, because I'm a licensed customer, but it is using their
> commercial license.  That means I can't do the POI work on the more complex
> and complete steps above.

I think it's publically available source, just not under a license we can 
use. I've certainly found the source when tracking down some odd bugs! You 
won't be able to re-use their code, but I don't think that having seen it 
precludes you writing the POI one

> I'm also willing to get my boss to contact Vaadin and see if they will
> release the relevant bits of conditional formatting code to us for use in
> POI with the Apache 2 license.  She's very good at that sort of thing.  I
> wouldn't want it directly, but the patterns it follows likely mirror some
> of what we need, and I don't want to cause a problem where there doesn't
> need to be one.

Maybe the way to sell it is not as "can you give" or "can you relicense", 
but "would you like to make someone else take over the development and 
maintenance for you" :)


To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message