D2WContext newContext=new D2WContext(session); String newTask=context.task().equals("edit") ? "inspect" : context.task(); newContext.takeValueForKey(newTask,"task");    newContext.takeValueForKey("printerFriendly","forcedSubTask"); newContext.takeValueForKey(context.valueForKey("pageName"),"existingPageName"); newContext.takeValueForKey(context.valueForKey("subTask"),"existingSubTask"); newContext.takeValueForKey(context.valueForKey("pageConfiguration"),"pageConfiguration"); newContext.takeValueForKey(context.entity(),"entity"); WOComponent result=WOApplication.application().pageWithName((String)newContext.valueForKey("pageName"),session.context()); ((D2WPage)result).setLocalContext(newContext); return result;
return ERD2WFactory.erFactory().printerFriendlyPageForD2WContext(context, session);
    public static WOComponent printerFriendlyPageForD2WContext(D2WContext context, WOSession session) {        D2WContext newContext=new D2WContext(session);        String newTask=context.task().equals("edit") ? "inspect" : context.task();        newContext.takeValueForKey(newTask,"task");        // not using subTask directly here because the cache mechanism relies on being able to compute wether this key        // is 'computable' (subTask is since a rule can fire to give a default) or an external output//        newContext.takeValueForKey("printerFriendly","subTask");        newContext.takeValueForKey("printerFriendly","forcedSubTask");        newContext.takeValueForKey(context.valueForKey("pageName"),"existingPageName");        newContext.takeValueForKey(context.valueForKey("subTask"),"existingSubTask");        newContext.takeValueForKey(context.valueForKey("pageConfiguration"),"pageConfiguration");        newContext.takeValueForKey(context.entity(),"entity");        WOComponent result=WOApplication.application().pageWithName((String)newContext.valueForKey("pageName"),session.context());        ((D2WPage)result).setLocalContext(newContext);        return result;    }