You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Geoff Callender (JIRA)" <de...@tapestry.apache.org> on 2007/04/25 15:22:15 UTC

[jira] Created: (TAPESTRY-1429) Add getLink() to ICallback

Add getLink() to ICallback
--------------------------

                 Key: TAPESTRY-1429
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
             Project: Tapestry
          Issue Type: Improvement
          Components: Core Components
    Affects Versions: 4.0.2, 4.1.2, 4.2
            Reporter: Geoff Callender


I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.

	public ILink getLink(IRequestCycle cycle);

The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.

Suggested implementation:


ExternalCallback.java
~~~~~~~~~~~~~~~~~

	public ILink getLink(IRequestCycle cycle)
	{
		Defense.notNull(cycle, "cycle");

		try {
			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);

			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));

			return link;
		}
		catch (ClassCastException ex) {
			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
		}
	}


DirectCallback.java
~~~~~~~~~~~~~~~

	public ILink getLink(IRequestCycle cycle)
	{
		Defense.notNull(cycle, "cycle");

        IPage page = cycle.getPage(_pageName);
        IComponent component = page.getNestedComponent(_componentIdPath);
        IDirect direct = null;

        try
        {
            direct = (IDirect) component;
            
			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));

			return link;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
                    component, null, ex);
        }
	}


PageCallback.java
~~~~~~~~~~~~~~~

	public ILink getLink(IRequestCycle cycle)
	{
		Defense.notNull(cycle, "cycle");

		try {
			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);

			ILink link = service.getLink(false, _pageName);

			return link;
		}
		catch (ClassCastException ex) {
			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
		}
	}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Geoff Callender (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529629 ] 

Geoff Callender commented on TAPESTRY-1429:
-------------------------------------------

Why not?  It's not a change to the interface, it's an addition.  Before:

public interface ICallback extends Serializable {
    void performCallback(IRequestCycle cycle);
}

After:

public interface ICallback extends Serializable {
    public void performCallback(IRequestCycle cycle);
    public ILink getLink(IRequestCycle cycle);
}

I have already provided all the code for the change in this ticket.  It's been in use in JumpStart for months.  Why not just add it?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.4
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Andreas Andreou (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529683 ] 

Andreas Andreou commented on TAPESTRY-1429:
-------------------------------------------

but it will break those implementing ICallback on their own - and they'll go screaming how this is a minor release, e.t.c.

Are you sure there's no other way to achive what you want?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.4
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Geoff Callender (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geoff Callender updated TAPESTRY-1429:
--------------------------------------

    Fix Version/s:     (was: 4.1.4)
                   4.2

OK, perhaps the Fix Version should be set to 4.2?

The best workaround, if it was possible, would be to extend Tapestry, BUT YOU CAN'T because the fields are all PRIVATE INSTEAD OF PROTECTED!!!  I've hit this same trouble again and again when trying to extend Tapestry.

For example, to work around this ticket I would like to extend ICallback to add in the getLink() method, eg.

public interface ICallback2 extends ICallback {
    public ILink getLink(IRequestCycle cycle);
}

and extend the 3 callback classes (DirectCallback, ExternalCallback, and PageCallback), eg.

public class DirectCallback2 extends DirectCallback implements ICallback2 {
	public ILink getLink(IRequestCycle cycle) {
		<etc>
	}
}

BUT, the fields I need to use in getLink() are private in the superclass and therefore not available.

As I said above, I've hit this same trouble again and again when trying to extend Tapestry.  I wonder if it makes sense to address this in design guidelines?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.2
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1429:
------------------------------------

    Fix Version/s:     (was: 4.1.2)
                   4.1.3

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.3
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Geoff Callender (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529830 ] 

Geoff Callender commented on TAPESTRY-1429:
-------------------------------------------

ILinkableCallback perhaps?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.2
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Martino Piccinato (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529791 ] 

Martino Piccinato commented on TAPESTRY-1429:
---------------------------------------------

Why not adding another interface (IExternalCallback ?) and have existing callbacks, already implementing ICallback, implementing this?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.2
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Andreas Andreou (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529608 ] 

Andreas Andreou commented on TAPESTRY-1429:
-------------------------------------------

I dont think it to be possible to change interfaces at this stage...So,
this is possibly a wontfix from me.

However, isn't it possible to create your own callbacks and
implement performCallback in such a way that they create that ILink and they then
throw a RedirectException with that url ?

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.4
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1429:
------------------------------------

    Fix Version/s: 4.1.2

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.2
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1429) Add getLink() to ICallback

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1429:
------------------------------------

    Fix Version/s:     (was: 4.1.3)
                   4.1.4

> Add getLink() to ICallback
> --------------------------
>
>                 Key: TAPESTRY-1429
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1429
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 4.0.2, 4.1.2, 4.2
>            Reporter: Geoff Callender
>             Fix For: 4.1.4
>
>
> I'd like to see a getLink() method added to ICallback so we can do redirect-after-post with the callback.
> 	public ILink getLink(IRequestCycle cycle);
> The reason is that I like to keep a "callback stack" as I descend into the pages.  A page can pop its calling page off the stack and often I'd like to redirect to it rather than just activate it.
> Suggested implementation:
> ExternalCallback.java
> ~~~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);
> 			ILink link = service.getLink(false, new ExternalServiceParameter(_pageName, _parameters));
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}
> DirectCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
>         IPage page = cycle.getPage(_pageName);
>         IComponent component = page.getNestedComponent(_componentIdPath);
>         IDirect direct = null;
>         try
>         {
>             direct = (IDirect) component;
>             
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.DIRECT_SERVICE);
> 			ILink link = service.getLink(false, new DirectServiceParameter(direct, _parameters));
> 			return link;
>         }
>         catch (ClassCastException ex)
>         {
>             throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component),
>                     component, null, ex);
>         }
> 	}
> PageCallback.java
> ~~~~~~~~~~~~~~~
> 	public ILink getLink(IRequestCycle cycle)
> 	{
> 		Defense.notNull(cycle, "cycle");
> 		try {
> 			IEngineService service = cycle.getInfrastructure().getServiceMap().getService(Tapestry.PAGE_SERVICE);
> 			ILink link = service.getLink(false, _pageName);
> 			return link;
> 		}
> 		catch (ClassCastException ex) {
> 			throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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