[ 
https://issues.apache.org/jira/browse/FOP-2729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286976#comment-16286976
 ] 

ASF GitHub Bot commented on FOP-2729:
-------------------------------------

GitHub user argv-minus-one opened a pull request:

    https://github.com/apache/fop/pull/5

    Allow the FOUserAgent class to be extended by applications.

    It used to be possible to provide default page dimensions on a per-UA 
basis. This was useful because the needed page dimensions may change for 
different runs (Fop instances) in the same application (same FopFactory 
instance). An application of mine needs this: the page dimensions are set to 
whatever the user previously entered in the Page Setup dialog.
    
    Since FOP 2.0, however, this is no longer possible, because there is no 
public or protected constructor to the FOUserAgent class. In my use case, that 
means there is no way to override the getPageWidth and getPageHeight methods.
    
    This PR makes FOUserAgent's constructor protected and take only a 
FopFactory parameter (so the resolver is still taken from the FopFactory). 
Applications needing to customize FOUserAgent's behavior can now do so.
    
    This is the same as the patch attached to 
[FOP-2729](https://issues.apache.org/jira/browse/FOP-2729).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/argv-minus-one/fop feature/extensible-foua

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/fop/pull/5.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5
    
----
commit 3643a33fabc2cdae8e51e39c84a74feef1e75341
Author: argv-minus-one <argv-minus-...@users.noreply.github.com>
Date:   2017-07-22T03:47:11Z

    Allow the FOUserAgent class to be extended by applications.

----


> Allow customizing FOUserAgent
> -----------------------------
>
>                 Key: FOP-2729
>                 URL: https://issues.apache.org/jira/browse/FOP-2729
>             Project: FOP
>          Issue Type: Improvement
>    Affects Versions: 2.2
>            Reporter: Alex Hvostov
>            Priority: Minor
>         Attachments: extensible-foua.patch
>
>
> It used to be possible to provide default page dimensions on a per-UA basis. 
> This was useful because the needed page dimensions may change for different 
> runs (Fop instances) in the same application (same FopFactory instance). An 
> application of mine needs this: the page dimensions are set to whatever the 
> user previously entered in the Page Setup dialog.
> Since FOP 2.0, however, this is no longer possible, because there is no 
> public or protected constructor to the FOUserAgent class. In my use case, 
> that means there is no way to override the getPageWidth and getPageHeight 
> methods.
> This patch makes FOUserAgent's constructor protected and take only a 
> FopFactory parameter (so the resolver is still taken from the FopFactory). 
> Applications needing to customize FOUserAgent's behavior can now do so.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to