[MGNLIMG-32] Unable to build checked out module Created: 29/Jan/09  Updated: 12/Jun/09  Resolved: 30/Apr/09

Status: Closed
Project: Imaging
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Olivier Marti Assignee: Magnolia International
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

I checked out http://svn.magnolia-cms.com/svn/community/modules/magnolia-module-imagefiltering/trunk/
but building it failed with the following exception:

[INFO] Compilation failure
/Users/omarti/Work/checkouts/3_Modules/magnolia-module-imagefiltering/src/main/java/info/magnolia/module/imagefiltering/ImagesProcessor.java:[164,59] unreported exception info.magnolia.content2bean.Content2BeanException; must be caught or declared to be thrown

Also this is the case for the cropperPage.class

Getting a svn history file allowed me then to build the jar. The following commit (per file) introduced the change prohibiting a proper build:

MAGNOLIA-2245 removed deprecated/unused FreeMarkerUtil and JSPIncludeUtil



 Comments   
Comment by Dean Arnold [ 03/Apr/09 ]

As a workaroung until Grégory fixes this issue; To make the plug-in compile (yet to test) I updated CropperPage.java line 104 from:

final CropAndResizeConfig cfg = (CropAndResizeConfig) Content2BeanUtil.setProperties(new CropAndResizeConfig(), node);

To:

CropAndResizeConfig cfg;
try {
     cfg = (CropAndResizeConfig) Content2BeanUtil.setProperties(new CropAndResizeConfig(), node);
} catch (Exception e) {
     throw new RuntimeException(e);
}

And updated ImagesProcessor.java line 164 from:

return (ImageFormat) Content2BeanUtil.setProperties(new ImageFormat(), dialogControlConfigNode);

To:

try {
    return (ImageFormat) Content2BeanUtil.setProperties(new ImageFormat(), dialogControlConfigNode);
} catch (Exception e) {
    throw new RuntimeException(e);
}
Comment by Dean Arnold [ 06/Apr/09 ]

Hi Grégory, The updates you made now allow the image filtering module to build successfully and all unit tests pass. Thanks!

There does appears to be one other issue, the module doesn't create the xxxx_resized node in the JCR (it does create the xxx_cropperInfo). I have added the 'class' node data with a value of 'info.magnolia.module.imagefiltering.ImageFilteringDialogHandler' to my dialog declaration. I see that the 'DialogHandlerManager' gets the Class (using classForName) of the ImageFilteringDialogHandler, but when the save button is clicked on the admin UI dialog, the 'onPostSave' method is not actually called. I cannot see that an instance of the 'ImageFilteringDialogHandler' class is ever created. I confirmed this by updating the 'ImageFilteringDialogHandler' and 'CropAndResizeControl' classes to add logging; the logging for 'CropAndResizeControl' was printed but logging for 'ImageFilteringDialogHandler' was not.

I saw that there is a 'deprecated' at the top of the 'ImageFilteringDialogHandler' class that indicates that the handler should only be used with 3.0 versions of magnolia. Unfortunately I couldn't find any details in the documentation that indicate an alternative mechanism. I also noticed that the Magnolia 4.0 documentation still states you should extend the 'ParagraphEditDialog' when creating a custom dialog.

Do you have a class for 3.6./4.0 that will allow the module to be triggered correctly on save, or is there a bug in Magnolia 4.0 that is preventing it from executing the 'ImageFilteringDialogHandler.onPostSave' method?

If you hadn't guessed, I'm, using magnolia 4.0.1.

Comment by Dean Arnold [ 07/Apr/09 ]

Hi Grégory, are my comments above related to MGNLIMG-5?

Comment by Magnolia International [ 07/Apr/09 ]

pretty much, yeah. That's the reason ImageFilteringDialogHandler, if i remember correctly. Not because there's a replacement but rather as a reminder.

Comment by Dean Arnold [ 07/Apr/09 ]

Hi Grégory, I there a resolution to MGNLIMG-5 i.e. a SaveHandler implementation. If not could you give some guidance on how I might go about implementing one that replicates the functionality of the ImageFilteringDialogHandler.

Comment by Magnolia International [ 24/Apr/09 ]

Hi Dean - sorry for the late reply - this probably will not even be happening; we're planning reworking on this module in the coming weeks, but will target an "on-demand" generation rather than "on-save".
(unless you give me a good reason why you'd want on-save )

Cheers,

-g

Comment by Dean Arnold [ 24/Apr/09 ]

Hi Grégory, If by 'On-Demand' you mean the filters will be applied as soon as/after they have been defined, that sounds good! I assume that will also fix the double save issue. When do you think this refactor will be completed? I have an immediate need for an image cropping module in magnolia, but waiting another 4-6 weeks is not a big deal.

Many Thanks!

Dean.

Comment by Magnolia International [ 24/Apr/09 ]

"on-demand" would be "when the image is requested" (i.e by having URLs like /image-generator/* handled specifically.)
It should make saving the dialogs much faster.

Estimated availability would be end of may if all goes well.

Comment by Dean Arnold [ 24/Apr/09 ]

Sounds great. Hope it goes well and look forward to the results!

Comment by Magnolia International [ 24/Apr/09 ]

You can watch this page - http://confluence.magnolia-cms.com/display/DEV/Imaging+module - it's just an old draft, but I reckon we'll update it soon

Comment by Magnolia International [ 30/Apr/09 ]

Closing this issue for now. We're doing major refactoring of the module. Followup MGNLIMG-33 if you're interested.

Generated at Mon Feb 12 02:11:36 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.