Package org.guvnor.common.services.project.builder.events

Examples of org.guvnor.common.services.project.builder.events.InvalidateDMOProjectCacheEvent


            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            org.uberfire.backend.vfs.Path path = paths.convert(projectPath);
            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));

            Project project = projectService.resolveProject(path);

            Map<String, AnnotationDefinitionTO> annotationDefs = modelerService.getAnnotationDefinitions();

            DataModelTO dataModel = modelerService.loadModel(project);

            String parentName = "A2";
            String parentPackage = "a";
            String parentLabelValue = "Parent";
            String parentDescriptionValue = "This is the parent object";
            String parentRoleValue = "EVENT";
            DataObjectTO parent = new DataObjectTO(parentName, parentPackage, null);
            parent.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.LABEL_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, parentLabelValue);
            parent.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.DESCRIPTION_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, parentDescriptionValue);
            parent.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.ROLE_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, parentRoleValue);
            dataModel.getDataObjects().add(parent);

            String parentFieldName = "a2_1";
            String parentFieldClass = "java.lang.String";
            String parentFieldLabelValue = "Attribute A2.1";
            String parentFieldDescriptionValue = "First attribute of A2";
            int parentFieldPositionValue = 1;
            ObjectPropertyTO parentProp = new ObjectPropertyTO(parentFieldName, parentFieldClass, false, true);
            parentProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.LABEL_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, parentFieldLabelValue);
            parentProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.DESCRIPTION_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, parentFieldDescriptionValue);
            parentProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.POSITION_ANNOTATON), AnnotationDefinitionTO.VALUE_PARAM, parentFieldPositionValue);
            parent.setProperties(Arrays.asList(parentProp));

            String extendingName = "B2";
            String extendingPackage = "a.b";
            String extendingLabelValue = "Extending";
            String extendingDescriptionValue = "This is the extending object";
            String extendingRoleValue = "EVENT";
            DataObjectTO extending = new DataObjectTO(extendingName, extendingPackage, null);
            // Extend B from A
            extending.setSuperClassName(parent.getClassName());
            extending.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.LABEL_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, extendingLabelValue);
            extending.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.DESCRIPTION_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, extendingDescriptionValue);
            extending.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.ROLE_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, extendingRoleValue);
            dataModel.getDataObjects().add(extending);

            String extendingFieldName = "b2_1";
            String extendingFieldClass = "java.lang.String";
            String extendingFieldLabelValue = "Attribute B2.1";
            String extendingFieldDescriptionValue = "First attribute of B2";
            int extendingFieldPositionValue = 1;
            ObjectPropertyTO extendingProp = new ObjectPropertyTO(extendingFieldName, extendingFieldClass, false, true);
            extendingProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.LABEL_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, extendingFieldLabelValue);
            extendingProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.DESCRIPTION_ANNOTATION), AnnotationDefinitionTO.VALUE_PARAM, extendingFieldDescriptionValue);
            extendingProp.addAnnotation(annotationDefs.get(AnnotationDefinitionTO.POSITION_ANNOTATON), AnnotationDefinitionTO.VALUE_PARAM, extendingFieldPositionValue);
            extending.setProperties(Arrays.asList(extendingProp));

            GenerationResult result = modelerService.saveModel(dataModel, project);
            assertNotNull(result);
            logger.info("**************************** -> Model saved in " + result.getGenerationTimeSeconds() + " seconds");

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

        } catch (Throwable e) {
            logger.error("Test failed : " + e.getMessage(), e);
View Full Code Here


            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            org.uberfire.backend.vfs.Path path = paths.convert(projectPath);
            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));

            Project project = projectService.resolveProject(path);

            Map<String, AnnotationDefinitionTO> annotationDefs = modelerService.getAnnotationDefinitions();

            DataModelTO dataModel = modelerService.loadModel(project);

            String parentName = "A3";
            String parentPackage = "a";
            DataObjectTO parent = new DataObjectTO(parentName, parentPackage, null);
            dataModel.getDataObjects().add(parent);

            String parentFieldName = "a3_1";
            String parentFieldClass = "java.lang.String";
            ObjectPropertyTO parentProp = new ObjectPropertyTO(parentFieldName, parentFieldClass, false, true);
            parent.setProperties(Arrays.asList(parentProp));

            String extendingName = "B3";
            String extendingPackage = "a.b";
            DataObjectTO extending = new DataObjectTO(extendingName, extendingPackage, null);
            // Extend B from A
            extending.setSuperClassName(parent.getClassName());
            dataModel.getDataObjects().add(extending);

            String extendingFieldName = "b3_1";
            String extendingFieldClass = "java.lang.String";
            ObjectPropertyTO extendingProp = new ObjectPropertyTO(extendingFieldName, extendingFieldClass, false, true);
            extending.setProperties(Arrays.asList(extendingProp));

            GenerationResult result = modelerService.saveModel(dataModel, project);
            assertNotNull(result);
            logger.info("**************************** -> Model saved in " + result.getGenerationTimeSeconds() + " seconds");

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);

View Full Code Here

                             metadataService.setUpAttributes( resource,
                                                              metadata ),
                             makeCommentedOption( comment ) );

            //Invalidate Project-level DMO cache in case user added a Declarative Type to their DRL. Tssk, Tssk.
            invalidateDMOProjectCache.fire( new InvalidateDMOProjectCacheEvent( resource ) );

            //Signal update to interested parties
            resourceUpdatedEvent.fire( new ResourceUpdatedEvent( resource,
                                                                 sessionInfo ) );
View Full Code Here

                                  + ", path: " + path
                                  + ", changeType: " + changeType );
        }

        if ( !notifiedProjects.containsKey( project.getRootPath().toURI() ) && isObservableResource( path ) ) {
            invalidateDMOProjectCacheEvent.fire( new InvalidateDMOProjectCacheEvent( sessionInfo,
                                                                                     project,
                                                                                     path ) );
            notifiedProjects.put( project.getRootPath().toURI(),
                                  Boolean.TRUE );
        }
View Full Code Here

                             metadataService.setUpAttributes( resource,
                                                              metadata ),
                             makeCommentedOption( comment ) );

            //Invalidate Project-level DMO cache in case user added a Declarative Type to their DRL. Tssk, Tssk.
            invalidateDMOProjectCache.fire( new InvalidateDMOProjectCacheEvent( resource ) );

            //Signal update to interested parties
            resourceUpdatedEvent.fire( new ResourceUpdatedEvent( resource ) );

            return resource;
View Full Code Here

            ioService.startBatch();
            ioService.move( projectDirectory, newProjectPath, makeCommentedOption( comment ) );
            pomService.save( newPathToPomXML, content, null, comment );
            ioService.endBatch();
            final Project newProject = resolveProject( Paths.convert( newProjectPath ) );
            invalidateDMOCache.fire( new InvalidateDMOProjectCacheEvent( sessionInfo, oldProject, oldProjectDir ) );
            renameProjectEvent.fire( new RenameProjectEvent( oldProject, newProject ) );

            return newPathToPomXML;
        } catch ( final Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

                                  + ", path: " + path
                                  + ", changeType: " + changeType );
        }

        if ( !notifiedProjects.containsKey( project.getRootPath().toURI() ) && isObservableResource( path ) ) {
            invalidateDMOProjectCacheEvent.fire( new InvalidateDMOProjectCacheEvent( sessionInfo,
                                                                                     project,
                                                                                     path ) );
            notifiedProjects.put( project.getRootPath().toURI(),
                                  Boolean.TRUE );
        }
View Full Code Here

                throw e;
            } finally {
                ioService.endBatch();
            }
            final Project newProject = resolveProject( Paths.convert( newProjectPath ) );
            invalidateDMOCache.fire( new InvalidateDMOProjectCacheEvent( sessionInfo, oldProject, oldProjectDir ) );
            renameProjectEvent.fire( new RenameProjectEvent( oldProject, newProject ) );

            return newPathToPomXML;
        } catch ( final Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

                             metadataService.setUpAttributes( resource,
                                                              metadata ),
                             makeCommentedOption( comment ) );

            //Invalidate Project-level DMO cache in case user added a Declarative Type to their DRL. Tssk, Tssk.
            invalidateDMOProjectCache.fire( new InvalidateDMOProjectCacheEvent( resource ) );

            //Signal update to interested parties
            resourceUpdatedEvent.fire( new ResourceUpdatedEvent( resource ) );

            return resource;
View Full Code Here

                throw e;
            } finally {
                ioService.endBatch();
            }
            final Project newProject = resolveProject( Paths.convert( newProjectPath ) );
            invalidateDMOCache.fire( new InvalidateDMOProjectCacheEvent( sessionInfo, oldProject, oldProjectDir ) );
            renameProjectEvent.fire( new RenameProjectEvent( oldProject, newProject ) );

            return newPathToPomXML;
        } catch ( final Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

TOP

Related Classes of org.guvnor.common.services.project.builder.events.InvalidateDMOProjectCacheEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.