Opened 14 years ago

Closed 13 years ago

#1445 closed enhancement (fixed)

Watermark RFC implementation

Reported by: brucedechant Owned by:
Priority: medium Milestone: 2.3
Component: Server Version:
Severity: blocker Keywords:
Cc: External ID:

Description

This ticket is for the watermark RFC implementation.

http://trac.osgeo.org/mapguide/wiki/MapGuideRfc108

Attachments (1)

WatermarkImplementation.patch (327.2 KB ) - added by brucedechant 14 years ago.
Initial patch

Download all attachments as: .zip

Change History (12)

by brucedechant, 14 years ago

Initial patch

comment:1 by brucedechant, 14 years ago

Initial patch submission r5139

comment:2 by brucedechant, 14 years ago

Fix some MdfParser issues

The newly submitted watermark code has issues in MdfParser, some of which I'm fixing here:

  • When saving the layer definition to a version older than 1.4.0, the watermark information needs to be saved as extended data. The code do to this was missing.
  • Numerous places in the watermark serialization code were directly dereferencing the version parameter without checking if it's NULL. NULL is a valid value for the version, and means use the latest version.
  • Updated some references to layer definition 1.3.0 to 1.4.0.

I also noticed that IOPointTypeStyle, IOLineTypeStyle, IOAreaTypeStyle, and IOCompositeTypeStyle had slightly flawed logic when saving the ShowInLegend property. When serializing to an older LDF version the code correctly saves these as extended data, but the version check needs was not excluding LDF 0.9.0 which does not support extended data.

r5143

comment:3 by brucedechant, 14 years ago

Update some additional references to layer definition 1.3.0 to 1.4.0.

r5144

comment:4 by brucedechant, 14 years ago

Severity: minorblocker

Additional watermark cleanup

  • Change the opacity memeber in SE_Raster to a raw double and not an SE_Double. The latter supports expressions, which are not needed for the opacity.
  • Add TODO comment about cleanup of StylizationEngine::StylizeWatermark
  • Some minor formatting

r5145

comment:5 by brucedechant, 14 years ago

Additional watermark cleanup

  • Fix Linux build

r5146

comment:6 by brucedechant, 14 years ago

More watermark cleanup - MdfModel

  • Numerous member variables were not being initialized in constructors - BAD!!
  • In MdfModel, member variables should be initialized to the corresponding default property value specified in the schema!
  • Never include files before stdafx.h. If precompiled headers is enabled then headers included before stdafx.h are ignored.
  • Renamed some class properties to be consistent with the schema. E.g. WatermarkXOffset had a Length property but in the schema it's called Offset. Now the code also uses Offset.
  • Renamed WatermarkResourceID proeprty on WatermarkInstance to just ResourceId.
  • New source files should have copyrights that only reference the current year.
  • Adjusted formatting to match the rest of the project.

Also cleaned up some documentation in the schema.

r5148

comment:7 by brucedechant, 14 years ago

More watermark cleanup - MdfModel

  • Numerous member variables were not being initialized in constructors - BAD!!
  • In MdfModel, member variables should be initialized to the corresponding default property value specified in the schema!
  • Never include files before stdafx.h. If precompiled headers is enabled then headers included before stdafx.h are ignored.
  • Renamed some class properties to be consistent with the schema. E.g. WatermarkXOffset had a Length property but in the schema it's called Offset. Now the code also uses Offset.
  • Renamed WatermarkResourceID proeprty on WatermarkInstance to just ResourceId.
  • New source files should have copyrights that only reference the current year.
  • Adjusted formatting to match the rest of the project.

Also cleaned up some documentation in the schema.

r5149

comment:8 by brucedechant, 14 years ago

One more watermark schema cleanup: change ALL to All in Usage enumeration.

r5150

comment:9 by brucedechant, 14 years ago

Additional watermark cleanup

Schema updates:

  • Improved documentation in the new schemas.
  • The WatermarkDefinitionType element has a WatermarkSource child element that contains the content for the watermark. I've renamed WatermarkSource to just Content.
  • The WatermarkType element has child elements named AppearanceOverrides and PositionOverrides, but these names are wrong since in each case there's only a single object overriding things. So I renamed the elements to AppearanceOverride and PositionOverride. The MdfModel and MdfParser code was already using the new names.
  • A couple elements defined ExtendedData child elements. I renamed the child elements to !ExtendedData1 to be consistent with other uses of extended data in our schemas.

MdfModel updates:

  • Updated WatermarkDefinition to account for the WatermarkSource => Content renaming.
  • Many of the new classes did not inherit from MdfRootObject. This based class provides support for handling unknown XML / extended data, and all MdfModel classes should inherit from it.

MdfParser updates:

  • The new IOWatermark classes were incorrectly deleting references to MdfModel objects in their destructors. The lifetime of these MdfModel objects is controlled by the MdfModel classes, and not the IO classes.
  • Serialization of numerous optional schema properties / elements was not being done correctly. The code needs to only serialize these properties / elements if they differ from the default value.
  • IOWatermarkInstance and IOWatermarkDefinition were not handling extended data correctly.
  • IOWatermarkDefinition::Write was not checking handling the case where the supplied version parameter was NULL.
  • Added additional comments to the new classes.

r5151

comment:10 by brucedechant, 14 years ago

Add svn:eol-style attribute to new watermark files.

r5160

comment:11 by jng, 13 years ago

Resolution: fixed
Status: newclosed

Implemented

Note: See TracTickets for help on using tickets.