Sha256: 41fd393fee57e9ca9c10a0f39620d967a08d73ce8af587fad2da57b9ef856ece

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 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.7.3 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.7.2 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.7.1 lib/generators/resty/setup/templates/PlaceHistoryMapper.java
resty-generators-0.7.0 lib/generators/resty/setup/templates/PlaceHistoryMapper.java