Package com.projity.session

Examples of com.projity.session.Session


    doingOpenDialog = true;
    finishAnyOperations();

    final ArrayList descriptors=new ArrayList();

      Session session=SessionFactory.getInstance().getSession(false);
    Job job=(Job)SessionFactory.callNoEx(session,"getLoadProjectDescriptorsJob",new Class[]{boolean.class,java.util.List.class,boolean.class},new Object[]{true,descriptors,!Environment.isAdministrator()});
      job.addSwingRunnable(new JobRunnable("Local: loadDocument"){ //$NON-NLS-1$
        public Object run() throws Exception{
                 final Closure setter=new Closure(){
                    public void execute(Object obj){

                    }
                };
                final Closure getter=new Closure(){
                    public void execute(Object obj){
                      final Object[] r=(Object[])obj;
                      if (r!=null){
                        DocumentData data=(DocumentData)r[0];
                        boolean openAs=(Boolean)r[1];
                        loadDocument(data.getUniqueId(),false,openAs);
                      }

                    }
                };
                try {
                  boolean allowMaster = getCurrentFrame() == null && Environment.isAdministrator();
                  OpenProjectDialog.getInstance(getFrame(),descriptors,Messages.getString("Text.openProject"),allowMaster, true, null).execute(setter,getter); //$NON-NLS-1$
                } finally {
                doingOpenDialog = false;
                }

                return null;
        }
    });
    session.schedule(job);
  }
View Full Code Here


//      }
//    }

    final ArrayList descriptors=new ArrayList();

      Session session=SessionFactory.getInstance().getSession(false);
    Job job=(Job)SessionFactory.callNoEx(session,"getLoadProjectDescriptorsJob",new Class[]{boolean.class,java.util.List.class,boolean.class},new Object[]{true,descriptors,true});
      job.addSwingRunnable(new JobRunnable("Local: add"){ //$NON-NLS-1$
        public Object run() throws Exception{
            Closure setter=new Closure(){
                public void execute(Object obj){

                }
            };
            Closure getter=new Closure(){
                public void execute(Object obj){
                  final Object[] r=(Object[])obj;
                  if (r!=null){
                     final DocumentData data=(DocumentData)r[0];
                    if (data.isMaster())
                      return;
                    insertSubproject(project, data.getUniqueId(), true);
//                    Project openedAlready = ProjectFactory.getInstance().findFromId(data.getUniqueId());
//
//              if (!project.canInsertProject(data.getUniqueId())) {
//                Alert.error("The selected project is already a subproject in this consolidated project.");
//                return;
//              }
//              if (openedAlready != null && openedAlready.isOpenedAsSubproject()) {
//                Alert.error("The selected project is already opened as a subproject in another consolidated project.");
//                return;
//              }
//              Subproject subprojectTask = new Subproject(project,data.getUniqueId());
//              Node subprojectNode = getCurrentFrame().addNodeForImpl(subprojectTask,NodeModel.EVENT);
//              ProjectFactory.getInstance().openSubproject(project, subprojectNode, true);
                  }
                }
            };

          try {
              OpenProjectDialog dlg = OpenProjectDialog.getInstance(getFrame(),descriptors,Messages.getString("Text.insertProject"),false, false, project); //$NON-NLS-1$
              dlg.execute(setter,getter);
          } catch (Exception e) {
            Alert.error(Messages.getString("Message.serverUnreachable"),getContainer()); //$NON-NLS-1$
            //TODO need more precise exception
            e.printStackTrace();
          } finally {
            doingOpenDialog = false;
          }
          return null;
        }
    });
    session.schedule(job);
  }
View Full Code Here

    SessionFactory.getInstance().setJobQueue(graphicManager.getJobQueue());

    PartnerInfo partnerInfo=null;
    if (!Environment.getStandAlone()) {
      Session session = SessionFactory.getInstance().getSession(false);
      try {
        partnerInfo=(PartnerInfo)SessionFactory.call(session,"retrievePartnerInfo",null,null);
      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here

        credentials.put("password",password);


        SessionFactory.getInstance().setCredentials(credentials);
        try {
          Session session = SessionFactory.getInstance().getSession(false);
        System.out.println("logging in");
          final GraphicManager gm = graphicManager;
          SessionFactory.callNoEx(session,"login",new Class[]{Closure.class},new Object[]{new Closure(){
            public void execute(Object arg0) {
              Map<String,String> env=(Map<String,String>)arg0;
View Full Code Here

    match.setToolTipText(Messages.getString("LookupDialog.EnterPartOfTheName")); //$NON-NLS-1$
    find = new JButton(Messages.getString("LookupDialog.Find")); //$NON-NLS-1$
    find.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        Session session = SessionFactory.getInstance().getSession(false);
        if (session != null)
          try {
            resultMap = (LinkedHashMap)SessionFactory.call(session,"queryLike",new Class[]{String.class,String.class},new Object[]{ types.getSelectedItem(), match.getText()});
            results= new ActionJList(resultMap.values().toArray());
            ((ActionJList)results).addActionListener(new ActionListener(){
View Full Code Here

  public static void log(final Exception e) {
    if (disabled)
      return;
    new Thread() {
      public void run() {
        Session session = SessionFactory.getInstance().getSession(false);
        if (session != null)
          session.logException(e);
      }}.start();
  }
View Full Code Here

    System.out.println(s);
    if (disabled)
      return;
    new Thread() {
      public void run() {
        Session session = SessionFactory.getInstance().getSession(false);
        if (session != null)
          session.logString(s);
      }}.start();
  }
View Full Code Here

    SessionFactory.getInstance().setJobQueue(graphicManager.getJobQueue());

    PartnerInfo partnerInfo=null;
    if (!Environment.getStandAlone()) {
      Session session = SessionFactory.getInstance().getSession(false);
      try {
        partnerInfo=(PartnerInfo)SessionFactory.call(session,"retrievePartnerInfo",null,null);
      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here

        credentials.put("password",password);


        SessionFactory.getInstance().setCredentials(credentials);
        try {
          Session session = SessionFactory.getInstance().getSession(false);
        System.out.println("logging in");
          final GraphicManager gm = graphicManager;
          SessionFactory.callNoEx(session,"login",new Class[]{Closure.class},new Object[]{new Closure(){
            public void execute(Object arg0) {
              Map<String,String> env=(Map<String,String>)arg0;
View Full Code Here

    System.out.println("MicrosoftImporter.getImportFileJob()");

      subprojects = new ArrayList();
      errorDescription = null;
      lastException = null;
      Session session=SessionFactory.getInstance().getSession(resourceMapping==null);
    Job job=new Job(session.getJobQueue(),"importFile",Messages.getString("MicrosoftImporter.Importing"),true); //$NON-NLS-1$ //$NON-NLS-2$
      job.addRunnable(new JobRunnable(Messages.getString("MicrosoftImporter.PrepareResources"),1.0f){ //$NON-NLS-1$

      public Object run() throws Exception{
        log.info("BEGIN: MicrosoftImporter.PrepareResources");
        MicrosoftImporter.this.jobRunnable = this;
View Full Code Here

TOP

Related Classes of com.projity.session.Session

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.