summaryrefslogtreecommitdiffstats
path: root/context/context-management
AgeCommit message (Collapse)AuthorFilesLines
2018-07-06Refactoring existing integration testswaqas.ikram2-15/+21
Change-Id: I1aedd94d5197b8c6513fc701e9df2aab4edec088 Issue-ID: POLICY-865 Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
2018-06-21Add unit test for apex pdp context schemaliamfallon8-11/+482
Unit tests added for context schema handling in the APEX PDP. Code coverage in the schema packages now above required limit. Issue-ID: POLICY-857 Change-Id: I66ad6eb0e758f7a80492caae514875229c28924f Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-06-18Fix package name, Unit Test for Context Albumliamfallon4-1/+352
package org.onap.policy.core renamed to org.onap.policy.apex.core Added unit text for context exceptions and context album Issue-ID: POLICY-857 Change-Id: I24f376245d9bc46db6a6a47ac3e8e6c559a16465 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-06-14Add YAML plugin and cleanup for checkstyleliamfallon2-24/+36
Bringing in the APEX YAML plugin, allows events with YAML bodies to be consumed by APEX. Also clean up of event protocol interface to make it not specific for JSON. Also some checkstyle changes on classes impacted by event protocol interface change. Change-Id: I7c3867ac508096fd8acad2488e61db87dfa1d6bd Issue-ID: POLICY-862 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-30Adding apex context moduleramverma43-0/+4188
Change-Id: I1284c2ba4c41a9cf721e141e096d1021be599a2d Issue-ID: POLICY-857 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
f='#n171'>171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

import {ClickedOutsideDirective} from "../directives/clicked-outside/clicked-outside-directive";
import {LoaderDirective} from "../directives/loader/loader-directive";
import {UserHeaderDetailsDirective} from "../directives/user-header-details/user-header-details-directive";
import {FileTypeDirective} from "../directives/file-type/file-type";
import {DownloadArtifactDirective} from "../directives/download-artifact/download-artifact";
import {EllipsisDirective} from "../directives/ellipsis/ellipsis-directive";
import {InvalidCharactersDirective} from "../directives/invalid-characters/invalid-characters";
import {ExpandCollapseDirective} from "../directives/utils/expand-collapse/expand-collapse";
import {PerfectScrollerDirective} from "../directives/perfect-scrollbar/angular-perfect-scrollbar";
import {SdcModalDirective} from "../directives/modal/sdc-modal";
import {FileOpenerDirective} from "../directives/file-opener/file-opener";
import {FileUploadDirective} from "../directives/file-upload/file-upload";
import {StructureTreeDirective} from "../directives/structure-tree/structure-tree-directive";
import {SmartTooltipDirective} from "../directives/utils/smart-tooltip/smart-tooltip";
import {PrintGraphScreenDirective} from "../directives/print-graph-screen/print-graph-screen";
import {TagDirective} from "../directives/tag/tag-directive";
import {SdcTagsDirective} from "../directives/utils/sdc-tags/sdc-tags";
import {SdcKeyboardEventsDirective} from "../directives/utils/sdc-keyboard-events/sdc-keyboard-events";
import {ExpandCollapseMenuBoxDirective} from "../directives/utils/expand-collapse-menu-box/expand-collaps-menu-box";
import {PunchOutDirective} from "../directives/punch-out/punch-out";
import {CustomValidationDirective} from "../directives/custom-validation/custom-validation";
import {EcompHeaderDirective} from "../directives/ecomp-header/ecomp-header";
import {EditNamePopoverDirective} from "../directives/edit-name-popover/edit-name-popover-directive";
import {DataTypeFieldsStructureDirective} from "../directives/property-types/data-type-fields-structure/data-type-fields-structure";
import {TypeMapDirective} from "../directives/property-types/type-map/type-map-directive";
import {TypeListDirective} from "../directives/property-types/type-list/type-list-directive";
import {SelectDataTypeFieldsStructureDirective} from "../directives/select-property-types/select-data-type-fields-structure/select-data-type-fields-structure";
import {SelectTypeMapDirective} from "../directives/select-property-types/select-type-map/select-type-map-directive";
import {SelectTypeListDirective} from "../directives/select-property-types/select-type-list/select-type-list-directive";
import {ValidationOnLoadDirective} from "../directives/utils/validation-on-load/validation-on-load";
import {InfoTooltipDirective} from "../directives/info-tooltip/info-tooltip";
import {SdcTabsDirective} from "../directives/sdc-tabs/sdc-tabs-directive";
import {SdcSingleTabDirective, InnerSdcSingleTabDirective} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive";
import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header";
import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel";
import {TopProgressDirective} from "../directives/layout/top-progress/top-progress";
import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox";
import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton";
import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat";
import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive";
import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive";
import {NodesFactory} from "../models/graph/nodes/nodes-factory";
import {LinksFactory} from "../models/graph/graph-links/links-factory";
import {ImageCreatorService} from "../directives/graphs-v2/image-creator/image-creator.service";
import {Palette} from "../directives/graphs-v2/palette/palette.directive";
import {CompositionGraph} from "../directives/graphs-v2/composition-graph/composition-graph.directive";
// import {RelationMenuDirective} from "../directives/graphs-v2/relation-menu/relation-menu";
import {DeploymentGraph} from "../directives/graphs-v2/deployment-graph/deployment-graph.directive";
import {CommonGraphUtils} from "../directives/graphs-v2/common/common-graph-utils";
import {CompositionGraphNodesUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils";
import {CompositionGraphGeneralUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-general-utils";
import {CompositionGraphLinkUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-links-utils";
import {DeploymentGraphGeneralUtils} from "../directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils";
import {CompositionGraphPaletteUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-palette-utils";
import {CompositionGraphZoneUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-zone-utils";
import {MatchCapabilitiesRequirementsUtils} from "../directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils";
import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
import {ServicePathGraphUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-service-path-utils";
import {PreventDoubleClickDirective} from "../directives/prevent-double-click/prevent-double-click";

let moduleName:string = 'Sdc.Directives';
let directiveModule:ng.IModule = angular.module(moduleName, []);

directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
directiveModule.directive('loader', LoaderDirective.factory);
directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
directiveModule.directive('ellipsis', EllipsisDirective.factory);
directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
directiveModule.directive('fileType', FileTypeDirective.factory);
directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
directiveModule.directive('ng1Modal', SdcModalDirective.factory);
directiveModule.directive('fileOpener', FileOpenerDirective.factory);
directiveModule.directive('fileUpload', FileUploadDirective.factory);
directiveModule.directive('structureTree', StructureTreeDirective.factory);
directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
directiveModule.directive('printGraphScreen', PrintGraphScreenDirective.factory);
directiveModule.directive('sdcTag', TagDirective.factory);
directiveModule.directive('sdcTags', SdcTagsDirective.factory);
directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
directiveModule.directive('punchOut', PunchOutDirective.factory);
directiveModule.directive('customValidation', CustomValidationDirective.factory);
directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
directiveModule.directive('typeMap', TypeMapDirective.factory);
directiveModule.directive('typeList', TypeListDirective.factory);
directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
directiveModule.directive('ng1Tabs', SdcTabsDirective.factory);
directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
directiveModule.directive('preventDoubleClick', PreventDoubleClickDirective.factory);
//
//
// // Layouts
directiveModule.directive('topProgress', TopProgressDirective.factory);
//
// // Elements
directiveModule.directive('ng1Checkbox', CheckboxElementDirective.factory);
directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory);
//
// // Events
directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory);
//
// //Inputs & Properties
directiveModule.directive('inputRow', InputRowDirective.factory);
directiveModule.directive('propertyRow', PropertyRowDirective.factory);
//
//
// // ------------------------------------------- Composition & Deployment Graphs------------------------------------------//
//
// //Util service for Graph
directiveModule.service('NodesFactory', NodesFactory);
directiveModule.service('LinksFactory', LinksFactory);
directiveModule.service('ImageCreatorService', ImageCreatorService);
//
// //composition
directiveModule.directive('palette', Palette.factory);
directiveModule.directive('compositionGraph', CompositionGraph.factory);
// directiveModule.directive('relationMenu', RelationMenuDirective.factory);
    //directiveModule.directive('assetPopover', AssetPopoverDirective.factory);
//
// //deployment
directiveModule.directive('deploymentGraph', DeploymentGraph.factory);
//
// //Graph Utils - Common
directiveModule.service('CommonGraphUtils', CommonGraphUtils);
//
// //Composition Graph Utils
directiveModule.service('CompositionGraphNodesUtils', CompositionGraphNodesUtils);
directiveModule.service('CompositionGraphGeneralUtils', CompositionGraphGeneralUtils);
directiveModule.service('CompositionGraphLinkUtils', CompositionGraphLinkUtils);
directiveModule.service('CompositionGraphPaletteUtils', CompositionGraphPaletteUtils);
directiveModule.service('CompositionGraphZoneUtils', CompositionGraphZoneUtils);
directiveModule.service('MatchCapabilitiesRequirementsUtils', MatchCapabilitiesRequirementsUtils);
directiveModule.service('ServicePathGraphUtils', ServicePathGraphUtils);

//
// //Deployment Graph Utils
directiveModule.service('DeploymentGraphGeneralUtils', DeploymentGraphGeneralUtils);


//Compoisiton right tab directives
directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
directiveModule.directive('requirementsList', RequirementsListDirective.factory);


// *** NG2 Components (downgraded) *** //
import { downgradeComponent } from "@angular/upgrade/static";
import { MenuListNg2Component } from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
import { TopNavComponent } from "../ng2/components/layout/top-nav/top-nav.component";
import { ZoneContainerComponent } from "../ng2/components/ui/canvas-zone/zone-container.component";
import { ZoneInstanceComponent } from "../ng2/components/ui/canvas-zone/zone-instance/zone-instance.component";
import { CompositionPanelComponent } from 'app/ng2/pages/composition/panel/panel.component';
import { CompositionPanelHeaderComponent } from 'app/ng2/pages/composition/panel/panel-header/panel-header.component';
import { PropertiesAssignmentComponent } from "../ng2/pages/properties-assignment/properties-assignment.page.component";
import { SearchWithAutoCompleteComponent } from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component";
import { PalettePopupPanelComponent } from "../ng2/components/ui/palette-popup-panel/palette-popup-panel.component";
import { ServicePathComponent } from '../ng2/components/logic/service-path/service-path.component';
import { ServicePathSelectorComponent } from '../ng2/components/logic/service-path-selector/service-path-selector.component';
import { MultilineEllipsisComponent } from "../ng2/shared/multiline-ellipsis/multiline-ellipsis.component";
import { InterfaceOperationComponent } from '../ng2/pages/interface-operation/interface-operation.page.component';
import { PluginFrameComponent } from "../ng2/components/ui/plugin/plugin-frame.component";
import { TileComponent } from "../ng2/components/ui/tile/tile.component";


directiveModule.directive('menuListNg2', downgradeComponent({
    component: MenuListNg2Component,
    inputs: ['props']
}) as angular.IDirectiveFactory);

directiveModule.directive('topNav', downgradeComponent({
    component: TopNavComponent,
    inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback', 'unsavedChanges', 'unsavedChangesCallback'],
    outputs: ['searchTermChange']
}) as ng.IDirectiveFactory);

directiveModule.directive('ng2ZoneContainer', downgradeComponent({
    component: ZoneContainerComponent,
        inputs: ['title', 'count', 'type', 'visible', 'minimized'],
    outputs: ['minimize', 'backgroundClick']
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2ZoneInstance', downgradeComponent({
        component: ZoneInstanceComponent,
        inputs: ['zoneInstance', 'isActive', 'activeInstanceMode', 'defaultIconText', 'isViewOnly', 'hidden', 'forceSave'],
        outputs: ['modeChange', 'tagHandleClick', 'assignmentSaveStart', 'assignmentSaveComplete']
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2CompositionPanel', downgradeComponent({
    component: CompositionPanelComponent,
    inputs: ['isViewOnly', 'isLoading', 'isCertified', 'selectedZoneInstanceId', 'selectedZoneInstanceType', 'selectedZoneInstanceName', 'topologyTemplate'],
}) as angular.IDirectiveFactory);

directiveModule.directive('propertiesAssignment', downgradeComponent({
    component: PropertiesAssignmentComponent
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
    component: SearchWithAutoCompleteComponent,
    inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
    outputs: ['searchChanged', 'searchButtonClicked']
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
    component: PalettePopupPanelComponent,
    inputs: [],
    outputs: []
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2ServicePath', downgradeComponent({
    component: ServicePathComponent,
    inputs: ['onCreate', 'service', 'isViewOnly'],
    outputs: []
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
    component: ServicePathSelectorComponent,
    inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
    outputs: []
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2InterfaceOperation', downgradeComponent({
    component: InterfaceOperationComponent,
    inputs: ['component', 'readonly'],
    outputs: []
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2MultilineEllipsis', downgradeComponent({
    component: MultilineEllipsisComponent,
    inputs: ['lines', 'lineHeight', 'className'],
    outputs: ['hasEllipsisChanged']
}) as angular.IDirectiveFactory);

directiveModule.directive('ng2UiTile', downgradeComponent({
    component: TileComponent,
    inputs: ['component'],
    outputs: ['onTileClick']
}) as angular.IDirectiveFactory);

directiveModule.directive('pluginFrame', downgradeComponent( {
    component: PluginFrameComponent,
    inputs: ['plugin', 'queryParams'],
    outputs: ['onLoadingDone']
}) as angular.IDirectiveFactory);