How to use the @nakedobjects/restful-objects.ObjectIdWrapper 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 / gemini / src / object / object.component.ts View on Github external
protected setup(routeData: PaneRouteData) {
        // subscription means may get with no oid

        if (!routeData.objectId) {
            this.mode = null;
            return;
        }

        this.expiredTransient = false;

        const oid = Ro.ObjectIdWrapper.fromObjectId(routeData.objectId, this.configService.config.keySeparator);

        if (this.object && !this.object.domainObject.getOid().isSame(oid)) {
            // object has changed - clear existing
            this.clearCurrentObject();
        }

        const isChanging = !this.object;

        const modeChanging = this.mode !== routeData.interactionMode;

        this.mode = routeData.interactionMode;

        const wasDirty = this.isDirty(routeData, oid);

        this.selectedDialogId = routeData.dialogId;
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / context.service.ts View on Github external
return () => {
                    const selfLink = parent.selfLink();
                    const oid = Ro.ObjectIdWrapper.fromLink(selfLink, this.keySeparator);
                    this.dirtyList.setDirty(oid);
                    this.setCurrentObjectsDirty();
                    clearCacheIfNecessary();
                };
            }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / gemini / src / dynamic-list / dynamic-list.component.ts View on Github external
getActionExtensions(routeData: PaneRouteData): Promise {
        return routeData.objectId
            ? this.context.getActionExtensionsFromObject(routeData.paneId, Ro.ObjectIdWrapper.fromObjectId(routeData.objectId, this.configService.config.keySeparator), routeData.actionId)
            : this.context.getActionExtensionsFromMenu(routeData.menuId, routeData.actionId);
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / gemini / src / attachment / attachment.component.ts View on Github external
protected setup(routeData: PaneRouteData) {

        const oid = Ro.ObjectIdWrapper.fromObjectId(routeData.objectId, this.configService.config.keySeparator);

        this.context.getObject(routeData.paneId, oid, routeData.interactionMode)
            .then((object: Ro.DomainObjectRepresentation) => {

                const attachmentId = routeData.attachmentId;
                const attachment = object.propertyMember(attachmentId);

                if (attachment) {
                    const avm = this.viewModelFactory.attachmentViewModel(attachment, routeData.paneId);

                    if (avm) {
                        avm.setImage(this);
                    }
                }
            })
            .catch((reject: ErrorWrapper) => this.error.handleError(reject));
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / error.service.ts View on Github external
this.setErrorPreprocessor(reject => {
            if (reject.category === ErrorCategory.HttpClientError && reject.httpErrorCode === HttpStatusCode.PreconditionFailed) {

                if (reject.originalUrl) {
                    const oid = Ro.ObjectIdWrapper.fromHref(reject.originalUrl, configService.config.keySeparator);
                    this.context.setConcurrencyError(oid);
                    reject.handled = true;
                }
            }
        });
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / gemini / src / object / object.component.ts View on Github external
isDirty(paneRouteData: PaneRouteData, oid?: Ro.ObjectIdWrapper) {
        oid = oid || Ro.ObjectIdWrapper.fromObjectId(paneRouteData.objectId, this.configService.config.keySeparator);
        return this.context.getIsDirty(oid);
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / context.service.ts View on Github external
getListFromObject = (routeData: PaneRouteData, page?: number, pageSize?: number) => {
        const objectId = routeData.objectId;
        const actionId = routeData.actionId;
        const parms = routeData.actionParams;
        const state = routeData.state;
        const oid = Ro.ObjectIdWrapper.fromObjectId(objectId, this.keySeparator);
        const paneId = routeData.paneId;
        const newPage = page || routeData.page;
        const newPageSize = pageSize || routeData.pageSize;
        const urlParms = Ro.getPagingParms(newPage, newPageSize);

        if (state === CollectionViewState.Table) {
            Ro.inlineCollectionItems(true, urlParms);
        }

        const promise = () => this.getObject(paneId, oid, InteractionMode.View)
            .then(object => this.getInvokableAction(object.actionMember(actionId)))
            .then(details => this.repLoader.invoke(details, parms, urlParms));

        return this.getList(paneId, promise, newPage, newPageSize);
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / color.service.ts View on Github external
private typeFromUrl(url: string): string {
        const oid = Ro.ObjectIdWrapper.fromHref(url, this.configService.config.keySeparator);
        return oid.domainType;
    }
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / gemini / src / list / list.component.ts View on Github external
getActionExtensions(routeData: PaneRouteData): Promise {
        return routeData.objectId
            ? this.context.getActionExtensionsFromObject(routeData.paneId, Ro.ObjectIdWrapper.fromObjectId(routeData.objectId, this.configService.config.keySeparator), routeData.actionId)
            : this.context.getActionExtensionsFromMenu(routeData.menuId, routeData.actionId);
    }