• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SingletonS2Container类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.seasar.framework.container.SingletonS2Container的典型用法代码示例。如果您正苦于以下问题:Java SingletonS2Container类的具体用法?Java SingletonS2Container怎么用?Java SingletonS2Container使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SingletonS2Container类属于org.seasar.framework.container包,在下文中一共展示了SingletonS2Container类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: userNameOverlapCheck

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void userNameOverlapCheck(ActionMessages errors){
	// userNameの重複チェック
    TMemberService tMemberService = SingletonS2Container.getComponent(TMemberService.class);
    TMember tMemberRec = tMemberService.findByUserName(userName);	
    TTempLoginService tTempLoginService = SingletonS2Container.getComponent(TTempLoginService.class);
    TTempLogin tTempLogin = tTempLoginService.findByUserName(userName);
    
    if (tTempLogin != null) {
    	errors.add("userName",new ActionMessage("残念!!このログインIDはすでに使われています。",false));
    }else{
    	//新規登録用
    	if (id == null) {
        	if (tMemberRec != null || tTempLogin != null) {
        		errors.add("userName",new ActionMessage("残念!!このログインIDはすでに使われています。",false));
        	}
        //更新用
    	}else{
        	if (!id.equals(tMemberRec.id)) {
        		errors.add("userName",new ActionMessage("残念!!このログインIDはすでに使われています。",false));
        	}
    	}
    }
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:24,代码来源:MemberForm.java


示例2: mailAddressOverlapCheck

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void mailAddressOverlapCheck(ActionMessages errors){
	TMemberService tMemberService = SingletonS2Container.getComponent(TMemberService.class);
	TMember tMemberRec = tMemberService.findByEmail(mail);
	//新規登録用
	if (id == null) {
    	if (tMemberRec != null) {
    		errors.add("mail",new ActionMessage("残念!!このメールアドレスはすでに使われています。",false));
    	}
    //更新用
	}else{
    	if (tMemberRec != null) {
    		if (!id.equals(tMemberRec.id)) {
        		errors.add("mail",new ActionMessage("残念!!このメールアドレスはすでに使われています。",false));
        	}
    	}
	}
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:18,代码来源:MemberForm.java


示例3: contactAddressRequiredCheck

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void contactAddressRequiredCheck(ActionMessages errors){
	//選択されたMemberが現役の部長以上の役職に付いている場合、連絡先をすべて登録しているかを確認する。
	TLeadersService tLeadersService = SingletonS2Container.getComponent(TLeadersService.class);
	List<TLeaders> tLeadersList = new ArrayList<TLeaders>();
	if (id != null) {
		tLeadersList = tLeadersService.findByMemberIdList(id);
    	if (tLeadersList.size() > 0) {
    		for (TLeaders tLeadersOne : tLeadersList) {
    			TClubService tClubService = SingletonS2Container.getComponent(TClubService.class);
    			List<TClub> tClub = tClubService.findByLeadersId(tLeadersOne.id);
    			if (tClub.size() > 0) {
    				//各部の現役の部長の場合
    				if (StringUtils.isEmpty(mail) || StringUtils.isEmpty(tel1) || StringUtils.isEmpty(tel2) || StringUtils.isEmpty(tel3)) {
                		errors.add("OfficerCheck",new ActionMessage("このメンバーには部長以上の役職に付いているため、連絡先を空白にすることはできません",false));
                	}
    			}else if (tLeadersOne.OfficerKind.equals(Integer.valueOf(LeadersKindCode.GASSYUKU.getCode())) || tLeadersOne.OfficerKind.equals(Integer.valueOf(LeadersKindCode.RIDAISAI.getCode())) || tLeadersOne.OfficerKind.equals(Integer.valueOf(LeadersKindCode.ETC.getCode())) || tLeadersOne.OfficerKind.equals(Integer.valueOf(LeadersKindCode.ACCOUNT.getCode()))) {
    				//部長以外の場合
    				if (StringUtils.isEmpty(mail) || StringUtils.isEmpty(tel1) || StringUtils.isEmpty(tel2) || StringUtils.isEmpty(tel3)) {
                		errors.add("OfficerCheck",new ActionMessage("このメンバーには部長以上の役職に付いているため、連絡先を空白にすることはできません",false));
                	}
    			}
    		}
    	}
	}
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:26,代码来源:MemberForm.java


示例4: deleteFile

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * TImageUploadに登録されている画像ファイルを削除し、該当のTImageUploadも削除する
 * 削除に失敗した場合true
 * 
 * @param TImageUpload
 * @return boolean
 * @author Hiroaki
 * 
 * */
public static boolean deleteFile(TImageUpload tImageUpload) {
	if (tImageUpload != null) {
		File file = new File(tImageUpload.filePath);
		if (file.exists()) {
			if (file.delete()) {
				TImageUploadService tImageUploadService = SingletonS2Container.getComponent(TImageUploadService.class);
				tImageUploadService.delete(tImageUpload);
			} else {
				return true;
			}
		} else {
			return true;
		}
	} else {
		return true;
	}
	return false;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:28,代码来源:TsuboneSystemUtil.java


示例5: createImageFile

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * 画像ファイルをアップロード
 * アップロードに成功した場合はTImageUploadのid
 * アップロードに失敗した場合はnull
 * 
 * @param FormFile imageFilePurposeCode
 * @return Integer
 * @author Hiroaki
 * 
 * */
public static Integer createImageFile(FormFile file, String imageFilePurposeCode) {
	Integer rtnInt = null;
   	
   	//ランダム文字を生成
   	String rm = RandomStringUtils.randomAlphabetic(10);
   	
   	//ファイルの格納先フォルダの絶対パスを取得(DBにこのパスを保存しておく)
   	String path = FilePathCode.HONBAN_IMAGE.getName() + rm + file.getFileName();
   	
   	//ファイル書き込み(ファイルパスが空の場合は何もしません)
       UploadUtil.write(path, file);
       
       //ファイル名とファイルパスをDBに追加
   	TImageUpload imageUpload = new TImageUpload();
   	imageUpload.fileName = rm + file.getFileName();
   	imageUpload.filePath = path;
   	imageUpload.ImageFilePurpose = Integer.valueOf(imageFilePurposeCode);
   	TImageUploadService tImageUploadService = SingletonS2Container.getComponent(TImageUploadService.class);
   	tImageUploadService.insert(imageUpload);
   	if (imageUpload.id != null) {
   		rtnInt = imageUpload.id;
   	}
   	return rtnInt;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:35,代码来源:TsuboneSystemUtil.java


示例6: deleteSubmitFile

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * 作品の削除処理
 * 
 * @param SubmitForm
 * @param deleteFlag
 * @return 
 * @author Hiroaki
 * 
 * */
public static void deleteSubmitFile(SubmitForm submitForm, boolean deleteFlag) {
	// キャプション画像の削除
	TImageUploadService tImageUploadService = SingletonS2Container.getComponent(TImageUploadService.class);
	if (!deleteFile(tImageUploadService.findById(submitForm.submitCaptionImageId))) {
		submitForm.submitCaptionImageId = null;
	}
	
	// 提出物の削除
	TSubmitService tSubmitService = SingletonS2Container.getComponent(TSubmitService.class);
	TSubmit tSubmit = tSubmitService.findById(submitForm.id);
	if (tSubmit != null) {
		File file = new File(tSubmit.submitProductFilePath);
		if (file.exists()) {
			if (file.delete()) {
				submitForm.submitProductFilePath = null;
				if (deleteFlag) {
					tSubmit.submitProductFilePath = null;
					tSubmit.deleteFlag = true;
					tSubmitService.update(tSubmit);
				}
			}
		}
	}
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:34,代码来源:TsuboneSystemUtil.java


示例7: login

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * <p>~/quickstart/auth/login</p>
 * @return リクエスト転送先情報
 */
@Execute(validator = true, input = "/auth.jsp")
public String login() {

	if (!this.authForm.account.equals("taro") || !this.authForm.password.equals("tarotaro")) {
		LOGGER.log("IAPP0000", new Object[] {this.authForm.account, this.request.getRequestedSessionId()});
		return "/auth.jsp";
	}

	if (this.request.getSession(false) != null) {
		this.request.getSession(false).invalidate();
	}
	LoginUserDto loginUserDto = SingletonS2Container.getComponent(LoginUserDto.class);
	loginUserDto.setAccount(this.authForm.account);
	loginUserDto.setAuthenticated(true);
	LOGGER.log("IAPP0001", new Object[] {loginUserDto.getAccount(), this.request.getRequestedSessionId()});

	// Redirecting to Index ("/").
	return "/?redirect=true";
}
 
开发者ID:ardito-jp,项目名称:sastruts-extension,代码行数:24,代码来源:AuthAction.java


示例8: obCheck

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void obCheck(ActionMessages errors){
	//役職に就いている人はOB宣言できない
	if (id != null) {
		if("true".equals(obFlag)){
			TAdminService tAdminService = SingletonS2Container.getComponent(TAdminService.class);
			TAdmin tAdmin = tAdminService.findById(id);
			TLeadersService tLeadersService = SingletonS2Container.getComponent(TLeadersService.class);
			List<TLeaders> tLeadersList = tLeadersService.findByMemberIdList(id);
			if(tAdmin != null || tLeadersList.size() > 0){
				obFlag = "false";
				errors.add("obFlag",new ActionMessage("役職についている人はOB宣言出来ません。",false));
			}
		}
	}
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:16,代码来源:MemberForm.java


示例9: adminUpdateCheck

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void adminUpdateCheck(ActionMessages errors){
	TAdminService tAdminService = SingletonS2Container.getComponent(TAdminService.class);
	List<TAdmin> tAdminList = tAdminService.findByMemberIdList(id);
	if(tAdminList.size() > 0){
		errors.add("OfficerCheck",new ActionMessage("このメンバーは管理者であり、編集には権限が必要です。",false));
	}
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:8,代码来源:MemberForm.java


示例10: getHeader

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private String getHeader() {
	TMemberService tMemberService = SingletonS2Container.getComponent(TMemberService.class);
	if (sendMemberID != null) {
		TMember tMember = tMemberService.findById(sendMemberID);
		StrBuilder builder = new StrBuilder();
		builder.append("\"");
		builder.append(tMember.hname);
		builder.append("\"");
		builder.append("さんより");
		builder.append("\n");
		builder.append("\n");
		return builder.toString();
	}
	return null;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:16,代码来源:MailManager.java


示例11: sendMail

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
public String sendMail(){
	
	String rtnMesse = new String();
	
	MailManager mailManager = SingletonS2Container.getComponent(MailManager.class);
	mailManager.setTitle(title);
	mailManager.setContent(content);
	
	//管理者に対して
	if(!toAddressAdmin.isEmpty()){
		mailManager.setSendMemberId(sendMemberID);
		mailManager.setContent(getContentUrlFactory(ActorKindCode.ADMIN.getCode()));
		mailManager.setToAddress(toAddressAdmin.toArray(new TMember[0]));
		error = mailManager.sendMail();
	}
	//leadersに対して
	if(!toAddressLeaders.isEmpty()){
		mailManager.setSendMemberId(sendMemberID);
		mailManager.setContent(getContentUrlFactory(ActorKindCode.LEADERS.getCode()));
		mailManager.setToAddress(toAddressLeaders.toArray(new TMember[0]));
		error = mailManager.sendMail();
	}
	//一般メンバーに対して
	if(!toAddressInd.isEmpty()){
		mailManager.setSendMemberId(sendMemberID);
		mailManager.setContent(getContentUrlFactory(ActorKindCode.MEMBER.getCode()));
		mailManager.setToAddress(toAddressInd.toArray(new TMember[0]));
		error = mailManager.sendMail();
	}
	//ログを残す
	setLog(error);
	
	if (error) {
		rtnMesse = "メールの送信に失敗しました";
	}else{
		rtnMesse = "メールの送信に成功しました";
	}
	
	return rtnMesse;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:41,代码来源:MailManagerUtil.java


示例12: setLog

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * DBにログを残す
 * @param notError
 */
@SuppressWarnings("deprecation")
private void setLog(boolean notError) {
	
	//以下メールの送信履歴を残す
	tMail.title = title;
	tMail.content = content;
	tMail.errorFlag = notError;
	tMail.registMemberId = sendMemberID;
	tMail.browsingRights = browsingRights;
	//本来はここで挿入を行うべきなので問題ない
	TMailService tMailService = SingletonS2Container.getComponent(TMailService.class);
	tMailService.insert(tMail);

	ArrayList<TMember> toAddress = new ArrayList<TMember>();
	toAddress.addAll(toAddressAdmin);
	toAddress.addAll(toAddressLeaders);
	toAddress.addAll(toAddressInd);
	for (TMember tMemberOne : toAddress) {
		TMailSendMember tMailSendMember = new TMailSendMember();
		tMailSendMember.mailId = tMail.id;
		tMailSendMember.memberId = tMemberOne.id;
		//本来はここで挿入を行うべきなので問題ない
		TMailSendMemberService tMailSendMemberService = SingletonS2Container.getComponent(TMailSendMemberService.class);
		tMailSendMemberService.insert(tMailSendMember);
	}	
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:31,代码来源:MailManagerUtil.java


示例13: submitDownload

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * 作品のDownload処理
 * 
 * @param Integer submitId
 * @return null
 * @author Hiroaki
 * 
 * */
public static String submitDownload(Integer submitId){
	
	// ダウンロード対象の作品を取得する
	TSubmitService tSubmitService = SingletonS2Container.getComponent(TSubmitService.class);
   	TSubmit tSubmit = tSubmitService.findById(submitId);
   	
   	// 出力
   	if (tSubmit != null) {
   		downloadCommon(tSubmit.submitProductFilePath, tSubmit.submitName);
   	}
   	
	return null;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:22,代码来源:TsuboneSystemUtil.java


示例14: deleteCustom

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
public int deleteCustom (TClub tClub) {
	//該当の部を論理削除
	TClub tClubDelete = tClub;
	tClubDelete.deleteFlag = Boolean.valueOf(true);
	tClubDelete.LeadersId = null;
	int i = super.update(tClubDelete);
	//部長のレコードを削除
	TLeadersService tLeadersService = SingletonS2Container.getComponent(TLeadersService.class);
	tLeadersService.delete(tClub.tLeaders);
	
	return i;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:13,代码来源:TClubService.java


示例15: initOdenOSConfig

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void initOdenOSConfig() {
	if (odenOSConfig == null) {
		odenOSConfig = SingletonS2Container.getComponent(OdenOSConfig.class);
		if (odenOSConfig == null) {
			String message = "Failed to get OdenOSConfig component from DI container.";
			LOG.error(message);
			throw new IllegalStateException(message);
		}
	}
}
 
开发者ID:o3project,项目名称:mlo-net,代码行数:11,代码来源:OdenosPktDriver.java


示例16: start

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	LOG.info("MloClient#start() starts.");
	instance = this;
	
	// Launches Seasar2 
	try {
		SingletonS2ContainerFactory.setConfigPath("app.dicon");
		SingletonS2ContainerFactory.init();
		LOG.info("S2Container has been initialized.");
		
		sliceDataManager = SingletonS2Container.getComponent("sliceDataManager");
		clientConfig = SingletonS2Container.getComponent("clientConfig");
		LOG.info("S2 task has been started.");
	} catch (RuntimeException e) {
		LOG.fatal("Failed to initialize S2.", e);
		throw e;
	}
	
	executorService = Executors.newSingleThreadExecutor();
	
	sliceTaskFactory = new SliceTaskFactoryImpl(this);
	
	// Sets window title.
	stage = primaryStage; 
	stage.setTitle(ClientConfigConstants.APP_NAME);
	//stage.setResizable(false);

	infoViewCtrl = FXMLUtil.createController(MloInfoViewController.class, "info.fxml");
	updateViewCtrl = FXMLUtil.createController(MloUpdateViewController.class, "update.fxml");
	createViewCtrl = FXMLUtil.createController(MloCreateViewController.class, "create.fxml");
	
	indicatorStage = createIndicatorStage();
	
	resultDlgCtrl = FXMLUtil.createController(ResultDialogboxControllerImpl.class, "resultDialogbox.fxml");

	infoViewCtrl.setTopologyViewUrl(clientConfig.getTopologyViewUri());
	
	if(ClientConfigConstants.CLIENT_TYPE_OTHER.equals(clientConfig.getSrcComponentName())){
	}
	
	// Sets default flow settings.
	FlowDto defaultFlowDto = createDefaultFlowDto();
	updateViewCtrl.setDefaultFlowDto(defaultFlowDto);
	createViewCtrl.setDefaultFlowDto(defaultFlowDto);
	
	// Creates and setups main stage.
	//Parent root = mainViewCtrl.getRoot();
	Parent root = infoViewCtrl.getRoot();
	Scene scene = new Scene(root);
	stage.setScene(scene);
	
	// Show stage
	//loginStage.show();
	stage.show();
	
	LOG.info("MloClient#start() successfully ends.");
}
 
开发者ID:o3project,项目名称:mlo-gui,代码行数:59,代码来源:MloClient.java


示例17: initListener

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
private void initListener() {
	if (listener == null) {
		listener = SingletonS2Container.getComponent(OdenOSListener.class);
		listener.setDriver(this);
	}
}
 
开发者ID:o3project,项目名称:mlo-net,代码行数:7,代码来源:OdenosPktDriver.java


示例18: getServletContext

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * サーブレットコンテキストを返します。
 *
 * @return サーブレットコンテキスト
 */
public static ServletContext getServletContext() {
    return SingletonS2Container.getComponent(ServletContext.class);
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:9,代码来源:ServletContextUtil.java


示例19: getRequest

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * リクエストを返します。
 *
 * @return リクエスト
 */
public static HttpServletRequest getRequest() {
    return SingletonS2Container.getComponent(HttpServletRequest.class);
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:9,代码来源:RequestUtil.java


示例20: getResponse

import org.seasar.framework.container.SingletonS2Container; //导入依赖的package包/类
/**
 * レスポンスを返します。
 *
 * @return レスポンス
 */
public static HttpServletResponse getResponse() {
    return SingletonS2Container.getComponent(HttpServletResponse.class);
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:9,代码来源:ResponseUtil.java



注:本文中的org.seasar.framework.container.SingletonS2Container类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AuthorizationRequest类代码示例发布时间:2022-05-22
下一篇:
Java PercentLayoutHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap