Examples of Sandbox


Examples of org.apache.maven.scm.provider.integrity.Sandbox

        getLogger().info( "Attempting to un-register sandbox in directory " + fileSet.getBasedir().getAbsolutePath() );
        RemoveScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.drop();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new RemoveScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

            boolean success = ( exitCode == 0 ? true : false );
            result = new LoginScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );

            // Next we will prepare the Project and Sandbox for the other commands
            Project siProject = new Project( api, iRepo.getConfigruationPath() );
            Sandbox siSandbox = new Sandbox( api, siProject, fileSet.getBasedir().getAbsolutePath() );
            iRepo.setProject( siProject );
            iRepo.setSandbox( siSandbox );
        }
        catch ( APIException aex )
        {
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

                                           boolean binary )
        throws ScmException
    {
        getLogger().info( "Attempting to add new files from directory " + fileSet.getBasedir().getAbsolutePath() );
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        Sandbox siSandbox = iRepo.getSandbox();
        String excludes = Sandbox.formatFilePatterns( fileSet.getExcludes() );
        String includes = Sandbox.formatFilePatterns( fileSet.getIncludes() );
        String msg = ( ( null == message || message.length() == 0 ) ? System.getProperty( "message" ) : message );
        List<ScmFile> addedFiles = siSandbox.addNonMembers( excludes, includes, msg );
        if ( siSandbox.getOverallAddSuccess() )
        {
            return new AddScmResult( "si add", addedFiles );
        }
        else
        {
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

        {
            // Initialize the list of ScmFile objects for the StatusScmResult
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();

            // Get a listing for all the changes in the sandbox
            Sandbox siSandbox = iRepo.getSandbox();
            // Get the excludes and includes list from the configuration
            String excludes = Sandbox.formatFilePatterns( fileSet.getExcludes() );
            String includes = Sandbox.formatFilePatterns( fileSet.getIncludes() );

            // Get the new members found in the sandbox
            List<ScmFile> newMemberList = siSandbox.getNewMembers( excludes, includes );
            // Update the scmFileList with our updates
            scmFileList.addAll( newMemberList );

            // Get the changed/dropped members from the sandbox
            List<WorkItem> changeList = siSandbox.getChangeList();
            for ( Iterator<WorkItem> wit = changeList.iterator(); wit.hasNext(); )
            {
                WorkItem wi = wit.next();
                File memberFile = new File( wi.getField( "name" ).getValueAsString() );
                // Separate the changes into files that have been updated and deleted files
                if ( siSandbox.hasWorkingFile( (Item) wi.getField( "wfdelta" ).getValue() ) )
                {
                    scmFileList.add( new ScmFile( memberFile.getAbsolutePath(), ScmFileStatus.UPDATED ) );
                }
                else
                {
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            File memberFile = new File( workingDirectory.getAbsoluteFile() + File.separator + filename );
            Response res = siSandbox.unlock( memberFile, filename );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

        getLogger().info( "Attempting make files writeable in Sandbox " + fileSet.getBasedir().getAbsolutePath() );
        EditScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.makeWriteable();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new EditScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

        {
            getLogger().info(
                "Attempting to checkout source for project " + iRepo.getProject().getConfigurationPath() );
            String checkoutDir = System.getProperty( "checkoutDirectory" );
            // Override the sandbox definition, if a checkout directory is specified for this command
            Sandbox siSandbox;
            if ( null != checkoutDir && checkoutDir.length() > 0 )
            {
                siSandbox = new Sandbox( iRepo.getAPISession(), iRepo.getProject(), checkoutDir );
                iRepo.setSandbox( siSandbox );
            }
            else
            {
                siSandbox = iRepo.getSandbox();
            }
            getLogger().info( "Sandbox location is " + siSandbox.getSandboxDir() );
            // Now attempt to create the sandbox, if it doesn't already exist
            if ( siSandbox.create() )
            {
                // Resynchronize the new or previously created sandbox
                Response res = siSandbox.resync();
                // Lets output what we got from running this command
                WorkItemIterator wit = res.getWorkItems();
                while ( wit.hasNext() )
                {
                    WorkItem wi = wit.next();
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox

        throws ScmException
    {
        getLogger().info( "Attempting to synchronize sandbox in " + fileSet.getBasedir().getAbsolutePath() );
        List<ScmFile> updatedFiles = new ArrayList<ScmFile>();
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        Sandbox siSandbox = iRepo.getSandbox();
        try
        {
            // Make sure we've got a valid sandbox, otherwise create it...
            if ( siSandbox.create() )
            {
                Response res = siSandbox.resync();
                // Lets capture what we got from running this resync
                WorkItemIterator wit = res.getWorkItems();
                while ( wit.hasNext() )
                {
                    WorkItem wi = wit.next();
View Full Code Here

Examples of org.broadleafcommerce.common.sandbox.domain.SandBox

            //clear any sandbox
            if (BLCRequestUtils.isOKtoUseSession(request)) {
                request.removeAttribute(BroadleafSandBoxResolver.SANDBOX_ID_VAR, WebRequest.SCOPE_GLOBAL_SESSION);
            }
        } else {
            SandBox sandBox = null;
            if (StringUtils.isNotBlank(request.getParameter(SANDBOX_REQ_PARAM))) {
                Long sandBoxId = Long.parseLong(request.getParameter(SANDBOX_REQ_PARAM));
                sandBox = sandBoxService.retrieveUserSandBoxForParent(adminUser.getId(), sandBoxId);
                if (sandBox == null) {
                    SandBox approvalOrUserSandBox = sandBoxService.retrieveSandBoxById(sandBoxId);
                    if (approvalOrUserSandBox.getSandBoxType().equals(SandBoxType.USER)) {
                        sandBox = approvalOrUserSandBox;
                    } else {
                        sandBox = sandBoxService.createUserSandBox(adminUser.getId(), approvalOrUserSandBox);
                    }
                }
            }

            if (sandBox == null) {
                Long previouslySetSandBoxId = null;
                if (BLCRequestUtils.isOKtoUseSession(request)) {
                    previouslySetSandBoxId = (Long) request.getAttribute(BroadleafSandBoxResolver.SANDBOX_ID_VAR,
                        WebRequest.SCOPE_GLOBAL_SESSION);
                }
                if (previouslySetSandBoxId != null) {
                    sandBox = sandBoxService.retrieveSandBoxById(previouslySetSandBoxId);
                }
            }

            if (sandBox == null) {
                List<SandBox> defaultSandBoxes = sandBoxService.retrieveSandBoxesByType(SandBoxType.DEFAULT);
                if (defaultSandBoxes.size() > 1) {
                    throw new IllegalStateException("Only one sandbox should be configured as default");
                }

                SandBox defaultSandBox;
                if (defaultSandBoxes.size() == 1) {
                    defaultSandBox = defaultSandBoxes.get(0);
                } else {
                    defaultSandBox = sandBoxService.createDefaultSandBox();
                }

                sandBox = sandBoxService.retrieveUserSandBoxForParent(adminUser.getId(), defaultSandBox.getId());
                if (sandBox == null) {
                    sandBox = sandBoxService.createUserSandBox(adminUser.getId(), defaultSandBox);
                }
            }
View Full Code Here

Examples of org.broadleafcommerce.common.sandbox.domain.SandBox

            if (brc != null) {
                brc.getAdditionalProperties().put("adminUser", adminUser);
            }

            Long overrideSandBoxId = adminUser.getOverrideSandBox() == null ? null : adminUser.getOverrideSandBox().getId();
            SandBox sandBox = sandBoxService.retrieveUserSandBox(adminUser.getId(), overrideSandBoxId, adminUser.getLogin());
            session.setAttribute(SANDBOX_ADMIN_ID_VAR, sandBox.getId());
            session.removeAttribute(SANDBOX_ID_VAR);
            AdminSandBoxContext context = new AdminSandBoxContext();
            context.setSandBoxId(sandBox.getId());
            context.setSandBoxMode(SandBoxMode.IMMEDIATE_COMMIT);
            context.setAdminUser(adminUser);
            SandBoxContext.setSandBoxContext(context);
        }
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.