Examples of Workspace


Examples of org.modeshape.jcr.api.Workspace

        // setup
        String workspaceA = "workspace_a";
        String workspaceB = "workspace_b";
        String workspaceC = "workspace_c";

        Workspace wsA, wsB, wsC;
        JcrSession sessA, sessB, sessC;

        JcrWorkspace rootWS = session.getWorkspace();
        rootWS.createWorkspace(workspaceA);
        sessA = repository.login(workspaceA);

        rootWS.createWorkspace(workspaceB);
        sessB = repository.login(workspaceB);

        rootWS.createWorkspace(workspaceC);
        sessC = repository.login(workspaceC);

        wsA = sessA.getWorkspace();
        wsB = sessB.getWorkspace();
        wsC = sessC.getWorkspace();

        // namespace registering
        wsA.getNamespaceRegistry().registerNamespace("brix", "http://brix-cms.googlecode.com");
        wsB.getNamespaceRegistry().registerNamespace("brix", "http://brix-cms.googlecode.com");
        wsC.getNamespaceRegistry().registerNamespace("brix", "http://brix-cms.googlecode.com");

        // initial imports
        tools.registerNodeTypes(sessA, "cnd/brix.cnd");
View Full Code Here

Examples of org.nlogo.nvm.Workspace

    BufferedImage image = null;

    try {

      Workspace ws = workspaceFactory.newInstance();
      String         command = "random-seed 0 " + ws.previewCommands();
      SimpleJobOwner owner   = new SimpleJobOwner("ImageGenerator", ws.world().mainRNG, Observer.class);
      ws.runCompiledCommands(owner, ws.compileCommands(command));

      image = ws.exportView();

      ws.dispose();

      return image;

    } catch(InterruptedException e) {
      //headless.dispose method can potentially throw an InterruptedException
View Full Code Here

Examples of org.opencastproject.workspace.api.Workspace

    // Create the executor service
    executor = new ExecuteServiceImpl();
    executor.activate(cc);

    // Create a mock workspace
    Workspace workspace = EasyMock.createNiceMock(Workspace.class);
    EasyMock.expect(workspace.get(baseDirURI)).andReturn(baseDir).anyTimes();
    EasyMock.replay(workspace);
    executor.setWorkspace(workspace);

    // Set up the text pattern to test
    PATTERN = String.format("The specified track (%s) is in the following location: %s",
View Full Code Here

Examples of org.purl.sword.base.Workspace

    {
      // we are dealing with the default service document

      // set the title of the workspace as per the name of the DSpace installation
      String ws = ConfigurationManager.getProperty("dspace.name");
      Workspace workspace = new Workspace();
      workspace.setTitle(ws);

      // next thing to do is determine whether the default is communities or collections
      boolean swordCommunities = ConfigurationManager.getBooleanProperty("sword.expose-communities");

      if (swordCommunities)
      {
        List<Community> comms = swordAuth.getAllowedCommunities(swordContext);
        for (Community comm : comms)
        {
          org.purl.sword.base.Collection scol = comGen.buildCollection(comm);
          workspace.addCollection(scol);
        }
      }
      else
      {
        List<Collection> cols = swordAuth.getAllowedCollections(swordContext);
        for (Collection col : cols)
        {
          org.purl.sword.base.Collection scol = colGen.buildCollection(col);
          workspace.addCollection(scol);
        }
      }

      service.addWorkspace(workspace);
    }
    else
    {
      // we are dealing with a partial or sub-service document
      DSpaceObject dso = urlManager.extractDSpaceObject(url);

      if (dso instanceof Collection)
      {
        Collection collection = (Collection) dso;
        Workspace workspace = new Workspace();
        workspace.setTitle(collection.getMetadata("name"));

        List<Item> items = swordAuth.getAllowedItems(swordContext, collection);
        for (Item item : items)
        {
          org.purl.sword.base.Collection scol = itemGen.buildCollection(item);
          workspace.addCollection(scol);
        }

        service.addWorkspace(workspace);
      }
      else if (dso instanceof Community)
      {
        Community community = (Community) dso;
        Workspace workspace = new Workspace();
        workspace.setTitle(community.getMetadata("name"));

        List<Collection> collections = swordAuth.getAllowedCollections(swordContext, community);
        for (Collection collection : collections)
        {
          org.purl.sword.base.Collection scol = colGen.buildCollection(collection);
          workspace.addCollection(scol);
        }

        List<Community> communities = swordAuth.getCommunities(swordContext, community);
        for (Community comm : communities)
        {
          org.purl.sword.base.Collection scol = comGen.buildCollection(comm);
          workspace.addCollection(scol);
        }

        service.addWorkspace(workspace);
      }
    }
View Full Code Here

Examples of org.restlet.ext.atom.Workspace

                    this.currentService.setBaseReference(new Reference(attr));
                }
                this.state = IN_SERVICE;
            } else if (localName.equalsIgnoreCase("workspace")) {
                if (this.state == IN_SERVICE) {
                    this.currentWorkspace = new Workspace(this.currentService);
                    String attr = attrs.getValue("xml:base");
                    if (attr != null) {
                        this.currentWorkspace.setBaseReference(new Reference(
                                attr));
                    }
View Full Code Here

Examples of org.syrup.WorkSpace

     *         LogEntries)
     */
    public static int operate(String[] args, InputStream i, OutputStream o)
        throws Exception
    {  
        WorkSpace sp = null;

        try
        {
            sp = (WorkSpace) (new InitialContext()).lookup("syrupWorkSpace");
        }
        catch (Exception e)
        {
            logger.log(Level.INFO, "Did not get syrupWorkSpace key via JNDI. Reverted to default SQLWorkSpace implementation");
            sp = new SQLWorkSpace();
        }

        if (args.length > 0)
        {

            // The first argument is the command.
            if (args[0].equals("reset"))
            {
                sp.reset();
            }
            else if (args[0].equals("in1"))
            {
                sp.set_in_1(read(i));
            }
            else if (args[0].equals("in2"))
            {
                sp.set_in_2(read(i));
            }
            else if (args[0].equals("out1"))
            {
                write(sp.get_out_1(), o);
            }
            else if (args[0].equals("out2"))
            {
                write(sp.get_out_2(), o);
            }
            else if (args[0].equals("match"))
            {
                PTaskTemplate template = new PTaskTemplateImpl(args);
                return match(sp, template, o);
View Full Code Here

Examples of ptolemy.kernel.util.Workspace

    /**
     */
    public static void main(String[] args) throws IllegalActionException,
            IllegalStateException, NameDuplicationException {
        // Set up Manager, Director and top level CompositeActor
        Workspace workSpc = new Workspace();
        TypedCompositeActor topLevelActor = new TypedCompositeActor(workSpc);
        topLevelActor.setName("universe");

        Manager manager = new Manager(workSpc, "manager");
        DDEDirector director = new DDEDirector(topLevelActor, "director");
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.