protected void doRevealPlace(final PlaceRequest request, final boolean updateBrowserUrl) {
Function<ContextCreation> createContext = new Function<ContextCreation>() {
@Override
public void execute(final Control<ContextCreation> control) {
final String nameToken = control.getContext().getRequest().getNameToken();
final SecurityContext context = securityFramework.getSecurityContext(nameToken);
if (context == null || (context instanceof ReadOnlyContext)) {
// force re-creation if read-only fallback
securityFramework.createSecurityContext(nameToken, new AsyncCallback<SecurityContext>() {
@Override
public void onFailure(Throwable throwable) {
control.getContext().setError(throwable);
control.abort();
}
@Override
public void onSuccess(SecurityContext securityContext) {
control.proceed();
}
});
} else {
control.proceed();
}
}
};
Outcome<ContextCreation> outcome = new Outcome<ContextCreation>() {
@Override
public void onFailure(final ContextCreation context) {
unlock();
revealDefaultPlace();
Console.error("Failed to create security context", context.getError().getMessage());
}
@Override
public void onSuccess(final ContextCreation context) {
// unlock(); // remove?
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
final PlaceRequest placeRequest = context.getRequest();
DefaultPlaceManager.super.doRevealPlace(placeRequest, updateBrowserUrl);
// we only fire LHS highlight events for real sections not top level categories
if(updateBrowserUrl) {
/*StringBuffer nameToken = new StringBuffer(placeRequest.getNameToken());