How to use the @nakedobjects/restful-objects.ActionResultRepresentation function in @nakedobjects/restful-objects

To help you get started, we’ve selected a few @nakedobjects/restful-objects examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / rep-loader.service.ts View on Github external
invoke = (action: Ro.ActionRepresentation | Ro.InvokableActionMember, parms: Dictionary, urlParms: Dictionary): Promise => {
        const invokeMap = action.getInvokeMap();
        if (invokeMap) {
            each(urlParms, (v, k) => invokeMap.setUrlParameter(k!, v));
            each(parms, (v, k) => invokeMap.setParameter(k!, v));
            return this.retrieve(invokeMap, Ro.ActionResultRepresentation);
        }
        return Promise.reject(`attempting to invoke uninvokable action ${action.actionId()}`);
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / rep-loader.service.ts View on Github external
private handleRedirectedObject(response: Ro.IHateoasModel, data: Ro.IRepresentation) {

        if (response instanceof Ro.ActionResultRepresentation && Ro.isIDomainObjectRepresentation(data)) {
            const actionResult: Ro.IActionInvokeRepresentation = {
                resultType: 'object',
                result: data,
                links: [],
                extensions: {}
            };
            return actionResult;
        }

        return data;
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / context.service.ts View on Github external
private invokeActionInternal(
        invokeMap: Ro.InvokeMap,
        action: Ro.ActionRepresentation | Ro.InvokableActionMember,
        fromPaneId: number,
        toPaneId: number,
        setDirty: () => void,
        gotoResult: boolean = false) {

        invokeMap.inlinePropertyDetails(false);

        if (action.extensions().returnType() === 'list' && action.extensions().renderEagerly()) {
            invokeMap.inlineCollectionItems(true);
        }

        return this.repLoader.retrieve(invokeMap, Ro.ActionResultRepresentation, action.parent.etagDigest)
            .then((result: Ro.ActionResultRepresentation) => {
                setDirty();
                this.setMessages(result);
                if (gotoResult) {
                    this.setResult(action, result, fromPaneId, toPaneId, 1, this.configService.config.defaultPageSize);
                }
                return result;
            });
    }