nakedobjects.spa
Version:
Single Page Application client for a Naked Objects application.
81 lines (80 loc) • 4.99 kB
TypeScript
/// <reference types="lodash" />
import { Location } from '@angular/common';
import { CiceroContextService } from '../cicero-context.service';
import { CommandResult } from './command-result';
import * as Routedata from '../route-data';
import * as Models from '../models';
import { UrlManagerService } from '../url-manager.service';
import { CiceroCommandFactoryService } from '../cicero-command-factory.service';
import { ContextService } from '../context.service';
import { MaskService } from '../mask.service';
import { ErrorService } from '../error.service';
import { ConfigService } from '../config.service';
import { Dictionary } from 'lodash';
import { CiceroRendererService } from '../cicero-renderer.service';
export declare abstract class Command {
protected urlManager: UrlManagerService;
protected location: Location;
protected commandFactory: CiceroCommandFactoryService;
protected context: ContextService;
protected mask: MaskService;
protected error: ErrorService;
protected configService: ConfigService;
protected ciceroContext: CiceroContextService;
protected ciceroRenderer: CiceroRendererService;
constructor(urlManager: UrlManagerService, location: Location, commandFactory: CiceroCommandFactoryService, context: ContextService, mask: MaskService, error: ErrorService, configService: ConfigService, ciceroContext: CiceroContextService, ciceroRenderer: CiceroRendererService);
argString: string | null;
chained: boolean;
shortCommand: string;
fullCommand: string;
helpText: string;
protected minArguments: number;
protected maxArguments: number;
protected keySeparator: string;
execute(): Promise<CommandResult>;
protected returnResult(input: string | null, output: string | null, changeState?: () => void, stopChain?: boolean): Promise<CommandResult>;
protected abstract doExecute(args: string | null, chained: boolean, result: CommandResult): Promise<CommandResult>;
abstract isAvailableInCurrentContext(): boolean;
protected mayNotBeChained(rider?: string): string;
checkMatch(matchText: string): void;
protected argumentAsString(argString: string | null, argNo: number, optional?: boolean, toLower?: boolean): string | undefined;
protected argumentAsNumber(args: string | null, argNo: number, optional?: boolean): number | null;
protected parseInt(input: string): number;
protected parseRange(arg?: string): {
start: number | null;
end: number | null;
};
protected getContextDescription(): string | null;
protected routeData(): Routedata.PaneRouteData;
protected isHome(): boolean;
protected isObject(): boolean;
protected getObject(): Promise<Models.DomainObjectRepresentation>;
protected isList(): boolean;
protected getList(): Promise<Models.ListRepresentation>;
protected isMenu(): boolean;
protected getMenu(): Promise<Models.MenuRepresentation>;
protected isDialog(): boolean;
protected isMultiChoiceField(field: Models.IField): boolean;
protected getActionForCurrentDialog(): Promise<Models.InvokableActionMember | Models.ActionRepresentation>;
protected isCollection(): boolean;
protected closeAnyOpenCollections(): void;
protected isTable(): boolean;
protected isEdit(): boolean;
protected isForm(): boolean;
protected isTransient(): boolean;
protected matchingProperties(obj: Models.DomainObjectRepresentation, match?: string): Models.PropertyMember[];
protected matchingCollections(obj: Models.DomainObjectRepresentation, match?: string): Models.CollectionMember[];
protected matchingParameters(action: Models.InvokableActionMember, match: string): Models.Parameter[];
protected matchFriendlyNameAndOrMenuPath<T extends Models.IHasExtensions>(reps: T[], match: string | undefined): T[];
protected findMatchingChoicesForRef(choices: Dictionary<Models.Value> | null, titleMatch: string): Models.Value[];
protected findMatchingChoicesForScalar(choices: Dictionary<Models.Value> | null, titleMatch: string): Models.Value[];
protected handleErrorResponse(err: Models.ErrorMap, getFriendlyName: (id: string) => string): Promise<CommandResult>;
protected handleErrorResponseNew(err: Models.ErrorMap, getFriendlyName: (id: string) => string): Promise<CommandResult>;
protected validationMessage(reason: string | null, value: Models.Value, fieldFriendlyName: string): string;
private fieldValidationMessage(errorValue, fieldFriendlyName);
protected valueForUrl(val: Models.Value, field: Models.IField): Models.Value | null;
private leanLink(val);
private addOrRemoveValue(valuesFromRouteData, val);
protected setFieldValueInContext(field: Models.Parameter, val: Models.Value): void;
protected setPropertyValueinContext(obj: Models.DomainObjectRepresentation, property: Models.PropertyMember, urlVal: Models.Value): void;
}