Beispiel #1
0
  public void load(Session session, String pageName) throws Exception {
    facebookComments = new FacebookComments(pageName);
    facebookComments.setUrl(pageName);

    WfPanel wfPanel = new WfPanel();
    wfPanel.session = session;
    wfPanel.load(session.getCompany().getComCode(), "read");

    setWfPanel(wfPanel);
  }
Beispiel #2
0
  public Object save() throws Exception {
    ICategory category = new Category();
    category.setCategoryId(Integer.parseInt(categories.getSelected()));
    this.setCategory(category);

    String appType = this.getAppTypePanel().getSelectedAppType();
    this.setAppType(appType);

    // 파일이 변경이 되어있지 않다면 변경을 안한다.
    if (this.getLogoFile().getFileTransfer() != null
        && this.getLogoFile().getFileTransfer().getFilename() != null
        && !"".equals(this.getLogoFile().getFileTransfer().getFilename())
        && this.getLogoFile().getFilename() != null
        && this.getLogoFile().getFilename().length() > 0) this.getLogoFile().upload();

    if (MetaworksContext.WHEN_NEW.equals(this.getMetaworksContext().getWhen())) {

      projectAnalysis(this.getAppTypePanel().getProjectId(), appType);

      //			appProject.setName(this.getAppName());
      //			appProject.setProjectAlias(this.getSubDomain());
      //			appProject.setType("app");
      //			appProject.setIsDistributed(false);
      //			appProject.setIsReleased(false);
      //			//앱에서 쓰는 글의 경우는 소셜네트워크에서 비공개 처리하기 위함입니다. 차후 수정
      //			appProject.setSecuopt("1");
      //			appProject.setParentId(session.getCompany().getComCode());
      //			appProject.setAuthorId(session.getUser().getUserId());
      //
      //			if(TenantContext.getThreadLocalInstance().getTenantId() != null)
      //				appProject.setCompanyId(TenantContext.getThreadLocalInstance().getTenantId());
      //			else
      //				appProject.setCompanyId(session.getCompany().getComCode());
      //
      //			appProject.setDescription(this.getSimpleOverview());
      //			appProject.setStartDate(new Date());
      //			appProject.createMe();

      this.setAppId(
          UniqueKeyGenerator.issueWorkItemKey(
                  ((ProcessManagerBean) processManager).getTransactionContext())
              .intValue());
      this.setCreateDate(Calendar.getInstance().getTime());
      this.setComcode(session.getCompany().getComCode());
      this.setComName(session.getCompany().getComName());
      this.setSubDomain(this.getSubDomain());
      //			this.setRunningVersion(Integer.parseInt(this.getReleaseVersion().getSelected()));
      this.setProjectId(this.getAppTypePanel().getProjectId());
      this.setStatus(STATUS_REQUEST);
      this.setLogoFile(logoFile);

      createDatabaseMe();
      flushDatabaseMe();

      // 앱 등록일 경우 프로세스 발행
      String defId = "app/applications.process";

      ProcessMap goProcess = new ProcessMap();
      goProcess.session = session;
      goProcess.processManager = processManager;
      goProcess.instanceView = instanceView;
      goProcess.setDefId(defId);

      // 프로세스 발행
      Long instId = Long.valueOf(goProcess.initializeProcess());

      // 프로세스 실행
      ResultPayload rp = new ResultPayload();
      rp.setProcessVariableChange(new KeyedParameter("appInformation", this));

      RoleMappingPanel roleMappingPanel =
          new RoleMappingPanel(processManager, goProcess.getDefId(), session);
      roleMappingPanel.putRoleMappings(processManager, instId.toString());

      // 무조건 compleate
      processManager.executeProcessByWorkitem(instId.toString(), rp);
      //			processManager.executeProcess(instId.toString());
      processManager.applyChanges();

      //			TopicMapping tm = new TopicMapping();
      //			tm.setTopicId(String.valueOf(String.valueOf(this.getAppId())));
      //			tm.setUserId(session.getUser().getUserId());
      //			tm.setUserName(session.getUser().getName());
      //			tm.getMetaworksContext().setWhen(this.getMetaworksContext().getWhen());
      //
      //			tm.saveMe();

    } else {

      syncToDatabaseMe();
      flushDatabaseMe();
    }

    // 이 부분에 vm 관련해서 뭔가를 해야할꺼 같음

    MyVendor myVendor = new MyVendor();
    myVendor.load(session);

    return new ModalPanel(myVendor);
  }