Sha256: 5b5f316927c240386b67ac37afacef8cc5e36ea1f61d33192ed8a43ea896bbf0

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

package <%= managed_package %>;

import javax.inject.Inject;
import javax.inject.Singleton;

<% if options[:session] -%>
import <%= models_package %>.User;

import com.google.gwt.place.shared.Place;

import <%= gwt_rails_package %>.places.RestfulPlace;
<% end -%>
import <%= gwt_rails_package %>.places.RestfulPlaceHistoryMapper;
<% if options[:session] -%>
import <%= gwt_rails_package %>.session.SessionManager;
<% end -%>

@Singleton
public class <%= application_name %>PlaceHistoryMapper extends RestfulPlaceHistoryMapper {
<% if options[:session] -%>

    private final SessionManager<User> manager;
<% end -%>

    @Inject
    public <%= application_name %>PlaceHistoryMapper(<% if options[:session] -%>SessionManager<User> manager<% end -%>){
<% if options[:session] -%>
        this.manager = manager;
<% end -%>
    }
<% if options[:session] -%>

    @Override
    public Place getPlace(String token) {
        RestfulPlace<?> place = (RestfulPlace<?>) super.getPlace(token);
        // place needs to be different on the level of equals in order to trigger an activity
        place.hasSession = manager.hasSession(); 
        return place;
    }
<% end -%>
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
resty-generators-0.6.0 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.5.3 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.5.1 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.5.0 lib/generators/resty/setup/templates/PlaceHistoryMapper.java