public void load() throws Exception { SelectBox categories = new SelectBox(); ICategory category = Category.loadRootCategory(); if (category.size() > 0) { while (category.next()) { String categoryId = Integer.toString(category.getCategoryId()); String categoryName = category.getCategoryName(); categories.add(categoryName, categoryId); } } // IProjectNode projectList = ProjectNode.load(session); // FilepathInfo filepathInfo = new FilepathInfo(); // int j = 0; // if(projectList.size() > 0) { // while(projectList.next()){ // if( j == 0 ){ // filepathInfo.setProjectId(projectList.getId()); // } // j++; // } // } // this.setReleaseVersion(filepathInfo.findReleaseVersions(filepathInfo.getProjectId())); this.setCategories(categories); AppTypePanel appTypePanel = new AppTypePanel(); appTypePanel.session = session; appTypePanel.setProjectId(this.getProjectId()); appTypePanel.setSelectedAppType(this.getAppType()); appTypePanel.setSelectedAppDetail(this.getUrl()); appTypePanel.load(); this.setAppTypePanel(appTypePanel); if (this.getLogoFile() == null) { this.setLogoFile(new MetaworksFile()); } }
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); }