本文整理汇总了Java中org.seasar.framework.container.SingletonS2Container.getComponent方法的典型用法代码示例。如果您正苦于以下问题:Java SingletonS2Container.getComponent方法的具体用法?Java SingletonS2Container.getComponent怎么用?Java SingletonS2Container.getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.seasar.framework.container.SingletonS2Container
的用法示例。
在下文中一共展示了SingletonS2Container.getComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
}
}
示例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));
}
}
}
}
示例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));
}
}
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
}
示例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";
}
示例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));
}
}
}
}
示例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));
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
}