List of usage examples for org.apache.commons.collections MapUtils getBooleanValue
public static boolean getBooleanValue(final Map map, final Object key)
From source file:grails.plugin.searchable.internal.compass.search.AbstractSearchableHitCollector.java
/** * Collect hits and return something; maybe a list of results, maybe a single result, ... * @param hits compass hits/*from w ww. j av a2 s . com*/ * @param options * @return the result object */ public Object collect(CompassHits hits, Map options) { boolean reload = MapUtils.getBooleanValue(options, "reload"); return collect(hits, reload, options); }
From source file:net.sf.zekr.common.resource.QuranText.java
/** * @return either simple or Uthmani Quran text based on the current theme * @throws IOException/*from www. j a v a 2 s. co m*/ */ public static QuranText getInstance() throws IOException { boolean uthmani = MapUtils.getBooleanValue(config.getTheme().getCurrent().props, "quran_uthmaniTextFile"); return getInstance(uthmani ? UTHMANI_MODE : SIMPLE_MODE); }
From source file:com.photon.phresco.framework.param.impl.IosDeployValidationImpl.java
public PossibleValues getValues(Map<String, Object> paramsMap) throws IOException, ParserConfigurationException, SAXException, ConfigurationException, PhrescoException { String rootModulePath = ""; String subModuleName = ""; PossibleValues possibleValues = new PossibleValues(); try {/*from w ww . j av a 2 s. c om*/ ApplicationInfo applicationInfo = (ApplicationInfo) paramsMap.get(KEY_APP_INFO); String buildNumber = (String) paramsMap.get(KEY_BUILD_NO); String rootModule = (String) paramsMap.get(KEY_ROOT_MODULE); if (StringUtils.isNotEmpty(rootModule)) { rootModulePath = Utility.getProjectHome() + rootModule; subModuleName = applicationInfo.getAppDirName(); } else { rootModulePath = Utility.getProjectHome() + applicationInfo.getAppDirName(); } if (StringUtils.isEmpty(buildNumber)) { throw new PhrescoException("Build number is empty "); } BuildInfo buildInfo = Utility.getBuildInfo(Integer.parseInt(buildNumber), getBuildInfoPath(rootModulePath, subModuleName).toString()); if (buildInfo == null) { throw new PhrescoException("Build info is not found for build number " + buildNumber); } Map<String, Boolean> options = buildInfo.getOptions(); if (options != null) { boolean createIpa = MapUtils.getBooleanValue(buildInfo.getOptions(), "canCreateIpa"); boolean deviceDeploy = MapUtils.getBooleanValue(buildInfo.getOptions(), "deviceDeploy"); if (!createIpa && !deviceDeploy) { // if it is simulator, show popup for following dependency Value value = new Value(); value.setValue("simulator"); // value.setDependency("sdkVersion,family,logs,buildNumber"); possibleValues.getValue().add(value); setShowPropValue(paramsMap, "sdkVersion", true); setShowPropValue(paramsMap, "family", true); setShowPropValue(paramsMap, "logs", true); setShowPropValue(paramsMap, "buildNumber", true); // set trigger simulator value setTriggerSimulatorValue(paramsMap, TRUE); return possibleValues; } else { // if it is device, it should return null and should not show any popup Value value = new Value(); value.setValue("device"); possibleValues.getValue().add(value); setShowPropValue(paramsMap, "sdkVersion", false); setShowPropValue(paramsMap, "family", false); setShowPropValue(paramsMap, "logs", false); setShowPropValue(paramsMap, "buildNumber", false); // set trigger simulator value setTriggerSimulatorValue(paramsMap, FALSE); return possibleValues; } } } catch (Exception e) { throw new PhrescoException(e); } return possibleValues; }
From source file:com.photon.phresco.framework.param.impl.IosShowFunctionalDeviceIdValidationImpl.java
private String getDependency(int buildNumber, String rootModulePath, String subModuleName) throws PhrescoException { try {/* w w w. j a v a 2s . c o m*/ BuildInfo buildInfo = Utility.getBuildInfo(buildNumber, getBuildInfoPath(rootModulePath, subModuleName).toString()); if (buildInfo == null) { throw new PhrescoException("Build info is not found for build number " + buildNumber); } Map<String, Boolean> options = buildInfo.getOptions(); if (options != null) { boolean createIpa = MapUtils.getBooleanValue(buildInfo.getOptions(), CAN_CREATE_IPA); boolean deviceDeploy = MapUtils.getBooleanValue(buildInfo.getOptions(), DEVICE_DEPLOY); if (!createIpa && !deviceDeploy) { // if it is simulator, show popup for following dependency return ""; } else { // if it is device, it should return null and should not show any popup return DEVICE_ID; } } } catch (Exception e) { throw new PhrescoException(e); } return ""; }
From source file:com.photon.phresco.framework.actions.applications.Build.java
public String deployIphone() { if (debugEnabled) { S_LOGGER.debug("Entering Method Build.deployIphone()"); }/*www .j a va2 s.c o m*/ try { ProjectAdministrator administrator = PhrescoFrameworkFactory.getProjectAdministrator(); Project project = administrator.getProject(projectCode); String buildNumber = getHttpRequest().getParameter(REQ_DEPLOY_BUILD_NUMBER); BuildInfo buildInfo = administrator.getBuildInfo(project, Integer.parseInt(buildNumber)); boolean createIpa = MapUtils.getBooleanValue(buildInfo.getOptions(), CAN_CREATE_IPA); boolean deviceDeploy = MapUtils.getBooleanValue(buildInfo.getOptions(), DEPLOY_TO_DEVICE); getHttpRequest().setAttribute(REQ_DEPLOY_BUILD_NUMBER, buildNumber); if (debugEnabled) { S_LOGGER.debug("Deploy IPhone build number" + buildNumber); } getHttpRequest().setAttribute("projectCode", projectCode); getHttpRequest().setAttribute(REQ_HIDE_DEPLOY_TO_SIMULATOR, new Boolean(!createIpa && !deviceDeploy ? true : false)); getHttpRequest().setAttribute(REQ_HIDE_DEPLOY_TO_DEVICE, new Boolean(createIpa && deviceDeploy ? true : false)); getHttpRequest().setAttribute(REQ_FROM_TAB, REQ_FROM_TAB_DEPLOY); // get list of sdk versions List<String> iphoneSimulatorSdks = IosSdkUtil.getMacSdksVersions(MacSdkType.iphonesimulator); getHttpRequest().setAttribute(REQ_IPHONE_SIMULATOR_SDKS, iphoneSimulatorSdks); } catch (Exception e) { if (debugEnabled) { S_LOGGER.error( "Entered into catch block of Build.Iphone()" + FrameworkUtil.getStackTraceAsString(e)); } new LogErrorReport(e, "Deploying Iphone"); } return APP_DEPLOY_IPHONE; }