当前位置: 首页>>代码示例>>Java>>正文


Java Action.INPUT属性代码示例

本文整理汇总了Java中com.opensymphony.xwork2.Action.INPUT属性的典型用法代码示例。如果您正苦于以下问题:Java Action.INPUT属性的具体用法?Java Action.INPUT怎么用?Java Action.INPUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.opensymphony.xwork2.Action的用法示例。


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

示例1: execute

/**
 * @return input
 */
public String execute() {
    BrowseService bs = ServiceLocatorFactory.getBrowseService();
    browseItems = new ArrayList<BrowseItems>();
    for (BrowseCategory cat : BrowseCategory.values()) {
        browseItems.add(new BrowseItems(cat, bs.countByBrowseCategory(cat)));
    }
    browseItems.add(new BrowseItems("browse.report.hybridizations", bs.hybridizationCount()));
    browseItems.add(new BrowseItems("browse.report.users", bs.userCount()));
    
    VocabularyService voc = ServiceLocatorFactory.getVocabularyService();
    this.categories = voc.searchForCharacteristicCategory(TermBasedCharacteristic.class, null);
    this.organisms = voc.getOrganisms();

    return Action.INPUT;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:18,代码来源:HomeAction.java

示例2: save

/**
 * Action to actually save the registration with authentication.
 * @return the directive for the next action / page to be directed to
 */
public String save() {
    try {
        // We call the service to save, then send email.  This is non-transactional behavior,
        // but it's okay in this case.  The request gets logged to our db, but if email doesn't
        // send, we tell the user to retry.  (We don't send email in service because Email helper
        // makes assumptions about the environment that are inappropriate for the service tier.)
        ServiceLocatorFactory.getRegistrationService().register(getRegistrationRequest());
        LOGGER.debug("done saving registration request; sending email");
        EmailHelper.registerEmail(getRegistrationRequest());
        EmailHelper.registerEmailAdmin(getRegistrationRequest());
        setSuccessMessage(ConfigurationHelper.getConfiguration().getString(ConfigParamEnum.THANKS_MESSAGE.name()));

        return Action.SUCCESS;
    } catch (MessagingException me) {
        LOGGER.error("Failed to send an email", me);
        ActionHelper.saveMessage(getText("registration.emailFailure"));
        return Action.INPUT;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:RegistrationAction.java

示例3: basicSearch

/**
 * This action queries for the result counts of each tab.
 * The tabs call other methods to return the actual data.
 * @return success
 */
public String basicSearch() {

    if (this.keyword != null && !checkKeyword()) {
        return Action.INPUT;
    }

    if (COMBINATION_SEARCH.equals(searchType)) {
       return comboSearch();
    } else if (SearchTypeSelection.SEARCH_BY_EXPERIMENT.name().equals(searchType)) {
        return basicExpSearch();
    } else if (SearchTypeSelection.SEARCH_BY_SAMPLE.name().equals(searchType)) {
        return SEARCH_CATEGORY_OTHER_CHAR.equals(categorySample)
            ? advBiometricSearch() : basicBiometricSearch();
    } else {
        return Action.INPUT;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:SearchAction.java

示例4: basicExpSearch

/**
 * This action queries for the result counts of each tab.
 * The tabs call other methods to return the actual data.
 * @return success
 */
public String basicExpSearch() {

    if (!checkExpFields()) {
        return Action.INPUT;
    }

    checkExpOrganism();

    SearchCategory[] categories = (categoryExp.equals(SEARCH_EXPERIMENT_CATEGORY_ALL)) ? SearchCategory.values()
            : new SearchCategory[] {SearchCategory.valueOf(categoryExp) };
    ProjectManagementService pms = ServiceLocatorFactory.getProjectManagementService();
    int projectCount = pms.searchCount(keyword, categories);
    tabs = new LinkedHashMap<String, Integer>();
    tabs.put(EXPERIMENTS_TAB, projectCount);
    setResultExpCount(projectCount);
    return Action.SUCCESS;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:SearchAction.java

示例5: advBiometricSearch

/**
 * This action queries for the result counts of each tab.
 * The tabs call other methods to return the actual data.
 * @return success
 */
public String advBiometricSearch() {
    if (!checkAdvSampleFields()) {
        return Action.INPUT;
    }
    tabs = new LinkedHashMap<String, Integer>();
    ProjectManagementService pms = ServiceLocatorFactory.getProjectManagementService();
    if (selectedCategory != null) {
        int sampleCount = pms.countSamplesByCharacteristicCategory(selectedCategory, keyword);
        tabs.put(SAMPLES_TAB, sampleCount);
        setResultSampleCount(sampleCount);

        int sourceCount = pms.countSourcesByCharacteristicCategory(selectedCategory, keyword);
        tabs.put(SOURCES_TAB, sourceCount);
        setResultSourceCount(sourceCount);

        return Action.SUCCESS;
    } else {
        addFieldError("selectedCategory",
                getText("search.category.other.characteristics.required"));

        return Action.INPUT;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:28,代码来源:SearchAction.java

示例6: execute

@Override
@SkipValidation
public String execute() {
    logger.debug("execute start.");
    initCollections(new String[] { "collectionProperties.article.category" });
    loadData();
    if (this.hasErrors()) {
        logger.debug("execute abnormally end.");
        return ADMIN_ERROR;
    }
    logger.debug("execute normally end.");
    return Action.INPUT;
}
 
开发者ID:luckyyeah,项目名称:YiDu-Novel,代码行数:13,代码来源:AbstractAdminBaseAction.java

示例7: intercept

@Override
public String intercept(ActionInvocation invocation) throws Exception {
	HttpServletRequest request = ServletActionContext.getRequest();
	HttpServletResponse response = ServletActionContext.getResponse();

	Cookie[] cookies = request.getCookies();
	if (cookies != null) {
		for (Cookie cookie : cookies) {
			if (cookie.getName().equals("uuid")) {
				return invocation.invoke();
			}
		}
	}

	String username = request.getParameter("username");
	String password = request.getParameter("password");

	if (username != null) {
		User user = userDao.get(username);
		if (user != null && user.getPassword().equals(password)) {
			response.addCookie(new Cookie("uuid", "" + user.getId()));
			invocation.getStack().setValue("user", user);
			return invocation.invoke();
		}
		return Action.INPUT;
	}

	return Action.LOGIN;
}
 
开发者ID:IngloriousCoderz,项目名称:java-web-frameworks,代码行数:29,代码来源:Auth.java

示例8: intercept

@Override
public String intercept(ActionInvocation invocation) throws Exception {
	HttpServletRequest request = ServletActionContext.getRequest();
	HttpServletResponse response = ServletActionContext.getResponse();

	Cookie[] cookies = request.getCookies();
	if (cookies != null) {
		for (Cookie cookie : cookies) {
			if (cookie.getName().equals("login")) {
				return invocation.invoke();
			}
		}
	}

	String username = request.getParameter("username");
	String password = request.getParameter("password");

	if (username != null) {
		User user = userDao.get(username);
		if (user != null && user.getPassword().equals(password)) {
			response.addCookie(new Cookie("login", username));
			invocation.getStack().setValue("username", username);
			return invocation.invoke();
		}
		return Action.INPUT;
	}

	return Action.LOGIN;
}
 
开发者ID:IngloriousCoderz,项目名称:java-web-frameworks,代码行数:29,代码来源:Auth.java

示例9: edit

/**
 * Edit view of an array design.
 *
 * @return input
 */
@SkipValidation
public String edit() {
    this.createMode = false;
    this.editMode = true;
    return Action.INPUT;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:11,代码来源:ArrayDesignAction.java

示例10: view

/**
 * Read-only view of an array design.
 *
 * @return input
 */
@SkipValidation
public String view() {
    this.createMode = false;
    this.editMode = false;
    return Action.INPUT;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:11,代码来源:ArrayDesignAction.java

示例11: create

/**
 * Creation of a new array design.
 *
 * @return input
 */
@SkipValidation
public String create() {
    this.createMode = true;
    this.editMode = true;
    return Action.INPUT;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:11,代码来源:ArrayDesignAction.java

示例12: saveMeta

/**
 * Save a new or existing array design.
 *
 * @return success
 */
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
@Validations(
    fieldExpressions = {@FieldExpressionValidator(fieldName = "arrayDesign.assayTypes", message = "",
        key = "errors.required", expression = "!arrayDesign.assayTypes.isEmpty") },
    requiredStrings = {@RequiredStringValidator(fieldName = "arrayDesign.version", key = "errors.required",
        message = "") },
    requiredFields = {
            @RequiredFieldValidator(fieldName = "arrayDesign.provider", key = "errors.required", message = ""),
            @RequiredFieldValidator(fieldName = "arrayDesign.technologyType", key = "errors.required",
                    message = ""),
            @RequiredFieldValidator(fieldName = "arrayDesign.organism", key = "errors.required", message = "") })
/**
 * Save the array design metadata.
 */
public
        String saveMeta() {
    if (!this.createMode && this.editMode) {

        if (ServiceLocatorFactory.getArrayDesignService().isDuplicate(this.arrayDesign)) {
            ActionHelper.saveMessage(getText("arraydesign.duplicate", new String[] {getArrayDesign().getName() }));
            return Action.INPUT;
        }

        saveImportFile();
        final List<Object> args = new ArrayList<Object>();
        args.add(getArrayDesign().getName());
        args.add(getArrayDesign().getProvider().getName());
        ActionHelper.saveMessage(getText("arraydesign.saved", args));
        return Action.SUCCESS;
    }
    this.editMode = true;
    return "metaValid";
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:38,代码来源:ArrayDesignAction.java

示例13: removeUsers

/**
 * Removes the selected users from the current collaborator group.
 * @return success
 * @throws CSTransactionException on CSM error
 * @throws CSObjectNotFoundException on CSM error
 */
@SkipValidation
public String removeUsers() throws CSTransactionException, CSObjectNotFoundException {
    if (getUsers() != null && !getUsers().isEmpty()) {
        ServiceLocatorFactory.getPermissionsManagementService().removeUsers(getTargetGroup(), getUsers());
        String s = "Users";
        if (getUsers().size() == 1) {
            User u = SecurityUtils.getAuthorizationManager().getUserById(getUsers().get(0).toString());
            s = u.getFirstName() + " " + u.getLastName() + " (" + u.getLoginName() + ")";
        }
        ActionHelper.saveMessage(getText("collaboration.group.removed", new String[] {s}));
    }
    return Action.INPUT;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:19,代码来源:CollaboratorsAction.java

示例14: basicBiometricSearch

/**
 * This action queries for the result counts of each tab.
 * The tabs call other methods to return the actual data.
 * @return success
 */
public String basicBiometricSearch() {
    if (!checkSampleFields()) {
        return Action.INPUT;
    }
    tabs = new LinkedHashMap<String, Integer>();
    ProjectManagementService pms = ServiceLocatorFactory.getProjectManagementService();

    checkSampleOrganism();

    SearchSampleCategory[] categories = (categorySample
            .equals(SEARCH_SAMPLE_CATEGORY_ALL)) ? SearchSampleCategory.values()
            : new SearchSampleCategory[] {SearchSampleCategory.valueOf(categorySample) };

    int sampleCount = pms.searchCount(keyword, Sample.class, categories);
    tabs.put(SAMPLES_TAB, sampleCount);
    setResultSampleCount(sampleCount);

    try {
        SearchSourceCategory[] scategories = (categorySample
                .equals(SEARCH_SAMPLE_CATEGORY_ALL)) ? SearchSourceCategory.values()
            : new SearchSourceCategory[] {SearchSourceCategory.valueOf(categorySample) };
        int sourceCount = pms.searchCount(keyword, Source.class, scategories);
        tabs.put(SOURCES_TAB, sourceCount);
        setResultSourceCount(sourceCount);
    } catch (IllegalArgumentException eie) {
        // throw away exception.
        LOG.info(categorySample + "is not a Source category.");
        tabs.put(SOURCES_TAB, 0);
    }

    return Action.SUCCESS;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:37,代码来源:SearchAction.java

示例15: doCreate

private String doCreate() throws SQLException {
	try {
		contactDAO.create(contact);
	}
	catch (Exception e) {
		message = e.getMessage();
		return Action.INPUT;
	}
    return Action.SUCCESS;
}
 
开发者ID:shevett,项目名称:congo,代码行数:10,代码来源:EditContact.java


注:本文中的com.opensymphony.xwork2.Action.INPUT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。