Package org.uberfire.backend.vfs

Examples of org.uberfire.backend.vfs.Path


            // Temporal fix for https://bugzilla.redhat.com/show_bug.cgi?id=998922
            model.getImports().addImport( new Import( "java.lang.Number" ) );

            final org.uberfire.java.nio.file.Path nioPath = Paths.convert( context ).resolve( fileName );
            final Path newPath = Paths.convert( nioPath );

            if ( ioService.exists( nioPath ) ) {
                throw new FileAlreadyExistsException( nioPath.toString() );
            }
View Full Code Here


     * @param path
     * @return
     */
    public String[] loadDslsForPackage( final Path path ) {
        final List<String> dsls = new ArrayList<String>();
        final Path packagePath = projectService.resolvePackage( path ).getPackageMainResourcesPath();
        final org.uberfire.java.nio.file.Path nioPackagePath = Paths.convert( packagePath );
        final Collection<org.uberfire.java.nio.file.Path> dslPaths = fileDiscoveryService.discoverFiles( nioPackagePath,
                                                                                                         FILTER_DSLS );
        for ( final org.uberfire.java.nio.file.Path dslPath : dslPaths ) {
            final String dslDefinition = ioService.readAllString( dslPath );
View Full Code Here

     * @param path
     * @return
     */
    public List<String> loadGlobalsForPackage( final Path path ) {
        final List<String> globals = new ArrayList<String>();
        final Path packagePath = projectService.resolvePackage( path ).getPackageMainResourcesPath();
        final org.uberfire.java.nio.file.Path nioPackagePath = Paths.convert( packagePath );
        final Collection<org.uberfire.java.nio.file.Path> globalPaths = fileDiscoveryService.discoverFiles( nioPackagePath,
                                                                                                            FILTER_GLOBALS );
        for ( final org.uberfire.java.nio.file.Path globalPath : globalPaths ) {
            final String globalDefinition = ioService.readAllString( globalPath );
View Full Code Here

        try {
            Asset jcrAsset = jcrRepositoryAssetService.loadRuleAsset( jcrAssetItem.getUUID() );

            RuleModel ruleModel = getBrlXmlPersistence().unmarshal( jcrAssetItem.getContent() );

            Path path = null;
            if ( ruleModel.hasDSLSentences() ) {
                path = migrationPathManager.generatePathForAsset( jcrModule,
                                                                  jcrAssetItem,
                                                                  true );
            } else {
View Full Code Here

                         Path previousVersionPath) {
        if ( !AssetFormats.DECISION_TABLE_GUIDED.equals( jcrAssetItem.getFormat() ) ) {
            throw new IllegalArgumentException( "The jcrAsset (" + jcrAssetItem.getName() + ") has the wrong format (" + jcrAssetItem.getFormat() + ")." );
        }

        Path path = migrationPathManager.generatePathForAsset( jcrModule,
                                                               jcrAssetItem );
        final org.uberfire.java.nio.file.Path nioPath = Paths.convert( path );
        //The asset was renamed in this version. We move this asset first.
        if(previousVersionPath != null && !previousVersionPath.equals(path)) {
            ioService.move(Paths.convert( previousVersionPath ), nioPath, StandardCopyOption.REPLACE_EXISTING);
        }

        String content = jcrAssetItem.getContent();
       
/*        while(content.indexOf("<auditLog>") > -1) {
            content  = content.replaceAll(content.substring(content.indexOf("<auditLog>"), content.indexOf("</auditLog>")+11), "");
        }
        */
        content = content.replaceAll( "org.drools.guvnor.client.modeldriven.dt52.Pattern52",
                                      "Pattern52" );

        GuidedDecisionTable52 model = GuidedDTXMLPersistence.getInstance().unmarshal( content );

        //Add package
        final Package pkg = projectService.resolvePackage( path );
        String pkName =pkg.getPackageName();
        try{
            if(pkName!=null && pkg.getPackageName().endsWith(path.getFileName())){
                pkName = pkg.getPackageName().substring(0,pkg.getPackageName().indexOf(path.getFileName())-1);
            }
        }catch (Exception e){

        }
        final String requiredPackageName = pkName;
View Full Code Here

                         Path previousVersionPath) {
        if ( !AssetFormats.SCORECARD_GUIDED.equals( jcrAssetItem.getFormat() ) ) {
            throw new IllegalArgumentException( "The jcrAsset (" + jcrAssetItem.getName() + ") has the wrong format (" + jcrAssetItem.getFormat() + ")." );
        }

        Path path = migrationPathManager.generatePathForAsset( jcrModule,
                                                               jcrAssetItem );
        final org.uberfire.java.nio.file.Path nioPath = Paths.convert( path );
        //The asset was renamed in this version. We move this asset first.
        if(previousVersionPath != null && !previousVersionPath.equals(path)) {
            ioService.move(Paths.convert( previousVersionPath ), nioPath, StandardCopyOption.REPLACE_EXISTING);
View Full Code Here

        for (CategoryItem c : jcrCategories) {
            //System.out.format("    Metadata: addCategory... \n" + c.getFullPath());
            metadata.addCategory(c.getFullPath());
        }

        Path path = migrationPathManager.generatePathForAsset(jcrModule, jcrAssetItem);
        return metadataService.setUpAttributes(path, metadata);

        //System.out.format("    Metadata migration done.\n");
    }
View Full Code Here

    protected MigrationPathManager migrationPathManager;

    public Path migrate( Module jcrModule,
                         AssetItem jcrAssetItem,
                         Path previousVersionPath) {
        Path path = migrationPathManager.generatePathForAsset( jcrModule,
                                                               jcrAssetItem );
        final org.uberfire.java.nio.file.Path nioPath = Paths.convert( path );
        //The asset was renamed in this version. We move this asset first.
        if(previousVersionPath != null && !previousVersionPath.equals(path)) {
            ioService.move(Paths.convert( previousVersionPath ), nioPath, StandardCopyOption.REPLACE_EXISTING);
View Full Code Here

                         List<String> globals) {
        if(globals.size() == 0) {
            return null;
        }
       
        Path path = migrationPathManager.generatePathForGlobal( jcrModule );
        final org.uberfire.java.nio.file.Path nioPath = paths.convert( path );
       
        StringBuffer content = new StringBuffer();
        for(String global : globals) {
            content.append(global);
View Full Code Here

        GAV gav = new GAV(groupId,
                          artifactId,
                          "0.0.1");
        POM pom = new POM(gav);

        Path modulePath = migrationPathManager.generateRootPath();
        projectService.newProject( makeRepository( modulePath ),
                                   migrationPathManager.normalizePackageName(jcrModule.getName()),
                                   pom,
                                   "http://localhost" );
    }
View Full Code Here

TOP

Related Classes of org.uberfire.backend.vfs.Path

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.