List of usage examples for java.lang Boolean equals
public boolean equals(Object obj)
From source file:mondrian.test.SchemaTest.java
public void testCubesVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<Cube name=\"Foo\" visible=\"@REPLACE_ME@\">\n" + " <Table name=\"store\"/>\n" + " <Dimension name=\"Store Type\">\n" + " <Hierarchy hasAll=\"true\">\n" + " <Level name=\"Store Type\" column=\"store_type\" uniqueMembers=\"true\"/>\n" + " </Hierarchy>\n" + " </Dimension>\n" + " <Measure name=\"Store Sqft\" column=\"store_sqft\" aggregator=\"sum\"\n" + " formatString=\"#,###\"/>\n" + "</Cube>\n"; cubeDef = cubeDef.replace("@REPLACE_ME@", String.valueOf(testValue)); final TestContext context = TestContext.instance().create(null, cubeDef, null, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); assertTrue(testValue.equals(cube.isVisible())); }/*www .j a v a 2s . com*/ }
From source file:mondrian.test.SchemaTest.java
public void testVirtualDimensionVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<VirtualCube name=\"Foo\" defaultMeasure=\"Store Sales\">\n" + " <VirtualCubeDimension cubeName=\"Sales\" name=\"Customers\" visible=\"@REPLACE_ME@\"/>\n" + " <VirtualCubeMeasure cubeName=\"Sales\" name=\"[Measures].[Store Sales]\"/>\n" + "</VirtualCube>\n"; cubeDef = cubeDef.replace("@REPLACE_ME@", String.valueOf(testValue)); final TestContext context = TestContext.instance().create(null, null, cubeDef, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); Dimension dim = null;/*from ww w. ja v a2 s.co m*/ for (Dimension dimCheck : cube.getDimensions()) { if (dimCheck.getName().equals("Customers")) { dim = dimCheck; } } assertNotNull(dim); assertTrue(testValue.equals(dim.isVisible())); } }
From source file:org.medici.bia.controller.manuscriptviewer.AjaxController.java
/** * //from w ww.j av a2s . c om * @param entryId Document identifier * @param volNum Volume Number * @param volLetExt Volume Letter Extension * @param imageType * @param imageProgTypeNum * @param firstRecord This is input parameter for Carta Form * @param secondRecord This is input parameter for Rubricario Form * @param imageOrder Unique id identifier inside volume. * @param total Global total of volume. * @param totalRubricario Total count page in rubricario section. * @param totalCarta Total count page in carta section. * @param totalAppendix Total count page in appendix section. * @param totalOther * @param totalGuardia * @param modeEdit * @return */ @RequestMapping(value = { "/src/mview/SearchCarta.json", "/de/mview/SearchCarta.json" }, method = RequestMethod.GET) public ModelAndView searchCarta(@RequestParam(value = "entryId", required = false) Integer entryId, @RequestParam(value = "volNum", required = false) Integer volNum, @RequestParam(value = "volLetExt", required = false) String volLetExt, @RequestParam(value = "insertNum", required = false) String insertNum, @RequestParam(value = "insertLet", required = false) String insertLet, @RequestParam(value = "imageType", required = false) String imageType, @RequestParam(value = "imageProgTypeNum", required = false) Integer imageProgTypeNum, @RequestParam(value = "missedNumbering", required = false) String missedNumbering, @RequestParam(value = "imageOrder", required = false) Integer imageOrder, @RequestParam(value = "total", required = false) Long total, @RequestParam(value = "totalRubricario", required = false) Long totalRubricario, @RequestParam(value = "totalCarta", required = false) Long totalCarta, @RequestParam(value = "totalAppendix", required = false) Long totalAppendix, @RequestParam(value = "totalOther", required = false) Long totalOther, @RequestParam(value = "totalGuardia", required = false) Long totalGuardia, @RequestParam(value = "formSubmitting", required = false) Boolean formSubmitting, @RequestParam(value = "modeEdit", required = false) Boolean modeEdit, HttpServletRequest request) { Map<String, Object> model = new HashMap<String, Object>(0); DocumentExplorer documentExplorer = new DocumentExplorer(entryId, volNum, org.medici.bia.common.util.StringUtils.nullTrim(volLetExt)); documentExplorer.setImage(new Image()); if (Boolean.TRUE.equals(formSubmitting)) { documentExplorer.getImage().setInsertNum(org.medici.bia.common.util.StringUtils.nullTrim(insertNum)); documentExplorer.getImage().setInsertLet(org.medici.bia.common.util.StringUtils.nullTrim(insertLet)); documentExplorer.getImage().setImageProgTypeNum(imageProgTypeNum); documentExplorer.getImage() .setMissedNumbering(org.medici.bia.common.util.StringUtils.nullTrim(missedNumbering)); // In this case recto/verso detail is not specified documentExplorer.getImage().setImageRectoVerso(null); if (!StringUtils.isEmpty(imageType)) { documentExplorer.getImage().setImageType(ImageType.valueOf(imageType)); } } else { documentExplorer.getImage().setImageOrder(imageOrder != null && imageOrder < 1 ? 1 : imageOrder); } documentExplorer.setTotal(total); documentExplorer.setTotalRubricario(totalRubricario); documentExplorer.setTotalCarta(totalCarta); documentExplorer.setTotalAppendix(totalAppendix); documentExplorer.setTotalOther(totalOther); documentExplorer.setTotalGuardia(totalGuardia); try { documentExplorer = getManuscriptViewerService().getDocumentExplorer(documentExplorer); if (documentExplorer.getImage().getImageName() != null) { model.put("entryId", documentExplorer.getEntryId()); model.put("volNum", documentExplorer.getVolNum()); model.put("volLetExt", documentExplorer.getVolLetExt()); model.put("insertNum", documentExplorer.getImage().getInsertNum()); model.put("insertExt", documentExplorer.getImage().getInsertLet()); model.put("imageId", documentExplorer.getImage().getImageId()); model.put("imageType", documentExplorer.getImage().getImageType()); model.put("imageName", documentExplorer.getImage().getImageName()); model.put("missedNumbering", documentExplorer.getImage().getMissedNumbering()); model.put("imageCompleteName", documentExplorer.getImage().toString()); model.put("imageProgTypeNum", documentExplorer.getImage().getImageProgTypeNum()); model.put("imageRectoVerso", documentExplorer.getImage().getImageRectoVerso()); model.put("imageOrder", documentExplorer.getImage().getImageOrder()); model.put("total", documentExplorer.getTotal()); model.put("totalRubricario", documentExplorer.getTotalRubricario()); model.put("totalCarta", documentExplorer.getTotalCarta()); model.put("totalAppendix", documentExplorer.getTotalAppendix()); model.put("totalOther", documentExplorer.getTotalOther()); model.put("totalGuardia", documentExplorer.getTotalGuardia()); model.put("previousPage", HtmlUtils.getDocumentExplorerPreviousPageUrl(documentExplorer)); model.put("nextPage", HtmlUtils.getDocumentExplorerNextPageUrl(documentExplorer)); if (modeEdit != null && modeEdit.equals(Boolean.TRUE)) { model.put("redirectUri", "/de/mview/EditDocumentInManuscriptViewer.do"); } else { model.put("redirectUri", "/src/mview/ShowDocumentInManuscriptViewer.do"); } } else { model.put("error", "image not found"); } } catch (ApplicationThrowable ath) { } return new ModelAndView("responseOK", model); }
From source file:org.etudes.component.app.jforum.JForumForumServiceImpl.java
/** * Check for date changes//from w ww .j av a 2 s . c o m * * @param forum Forum with user input dates * * @param existingForum Existing forum * * @return true - if dates are changed * false - if dates are not changed */ protected boolean checkDatesChanged(Forum forum, Forum existingForum) { boolean datesChanged = false; Date exisCatOpenDate = null, exisCatDueDate = null, exisCatAllowUntilDate = null, modCatOpenDate = null, modCatDueDate = null, modCatAllowUntilDate = null; Boolean exisHideUntilOpen = null, modHideUntilOpen = null; if (forum.getAccessDates() != null) { modCatOpenDate = forum.getAccessDates().getOpenDate(); modHideUntilOpen = forum.getAccessDates().isHideUntilOpen(); modCatDueDate = forum.getAccessDates().getDueDate(); modCatAllowUntilDate = forum.getAccessDates().getAllowUntilDate(); } if (existingForum.getAccessDates() != null) { exisCatOpenDate = existingForum.getAccessDates().getOpenDate(); exisHideUntilOpen = existingForum.getAccessDates().isHideUntilOpen(); exisCatDueDate = existingForum.getAccessDates().getDueDate(); exisCatAllowUntilDate = existingForum.getAccessDates().getAllowUntilDate(); } /*if (exisCatOpenDate == null) { if (modCatOpenDate != null) { datesChanged = true; } } else { if (modCatOpenDate == null) { datesChanged = true; } else if (!modCatOpenDate.equals(exisCatOpenDate)) { datesChanged = true; } } if (!datesChanged) { if (exisCatDueDate == null) { if (modCatDueDate != null) { datesChanged = true; } } else { if (modCatDueDate == null) { datesChanged = true; } else if (!modCatDueDate.equals(exisCatDueDate)) { datesChanged = true; } } }*/ // open date if (exisCatOpenDate == null) { if (modCatOpenDate != null) { datesChanged = true; } } else { if (modCatOpenDate == null) { datesChanged = true; } else if (!modCatOpenDate.equals(exisCatOpenDate)) { datesChanged = true; } else if (modCatOpenDate.equals(exisCatOpenDate)) { if (!exisHideUntilOpen.equals(modHideUntilOpen)) { datesChanged = true; } } } // due date if (!datesChanged) { if (exisCatDueDate == null) { if (modCatDueDate != null) { datesChanged = true; } } else { if (modCatDueDate == null) { datesChanged = true; } else if (!modCatDueDate.equals(exisCatDueDate)) { datesChanged = true; } } } // allow until date if (!datesChanged) { if (exisCatAllowUntilDate == null) { if (modCatAllowUntilDate != null) { datesChanged = true; } } else { if (modCatAllowUntilDate == null) { datesChanged = true; } else if (!modCatAllowUntilDate.equals(exisCatAllowUntilDate)) { datesChanged = true; } } } return datesChanged; }
From source file:mondrian.test.SchemaTest.java
public void testDimensionVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<Cube name=\"Foo\">\n" + " <Table name=\"store\"/>\n" + " <Dimension name=\"Bar\" visible=\"@REPLACE_ME@\">\n" + " <Hierarchy hasAll=\"true\">\n" + " <Level name=\"Store Type\" column=\"store_type\" uniqueMembers=\"true\"/>\n" + " </Hierarchy>\n" + " </Dimension>\n" + " <Measure name=\"Store Sqft\" column=\"store_sqft\" aggregator=\"sum\"\n" + " formatString=\"#,###\"/>\n" + "</Cube>\n"; cubeDef = cubeDef.replace("@REPLACE_ME@", String.valueOf(testValue)); final TestContext context = TestContext.instance().create(null, cubeDef, null, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); Dimension dim = null;/* w w w . j av a 2 s. co m*/ for (Dimension dimCheck : cube.getDimensions()) { if (dimCheck.getName().equals("Bar")) { dim = dimCheck; } } assertNotNull(dim); assertTrue(testValue.equals(dim.isVisible())); } }
From source file:org.jumpmind.symmetric.service.impl.RouterService.java
protected boolean producesCommonBatches(Channel channel, String nodeGroupId, List<TriggerRouter> triggerRouters) { String channelId = channel.getChannelId(); Boolean producesCommonBatches = !Constants.CHANNEL_CONFIG.equals(channelId) && !channel.isFileSyncFlag() && !channel.isReloadFlag() && !Constants.CHANNEL_HEARTBEAT.equals(channelId) ? true : false; if (producesCommonBatches && triggerRouters != null) { List<TriggerRouter> testableTriggerRouters = new ArrayList<TriggerRouter>(); for (TriggerRouter triggerRouter : triggerRouters) { if (triggerRouter.getTrigger().getChannelId().equals(channel.getChannelId())) { testableTriggerRouters.add(triggerRouter); } else { /*//w ww. jav a 2s . co m * Add any trigger router that is in another channel, but is * for a table that is in the current channel */ String anotherChannelTableName = triggerRouter.getTrigger().getFullyQualifiedSourceTableName(); for (TriggerRouter triggerRouter2 : triggerRouters) { String currentTableName = triggerRouter2.getTrigger().getFullyQualifiedSourceTableName(); String currentChannelId = triggerRouter2.getTrigger().getChannelId(); if (anotherChannelTableName.equals(currentTableName) && currentChannelId.equals(channelId)) { testableTriggerRouters.add(triggerRouter); } } } } for (TriggerRouter triggerRouter : testableTriggerRouters) { boolean isDefaultRouter = "default".equals(triggerRouter.getRouter().getRouterType()); /* * If the data router is not a default data router or there will * be incoming data on the channel where sync_on_incoming_batch * is on, then we can not do 'optimal' routing. When * sync_on_incoming_batch is on, then we might not be sending * data to all nodes in a node_group. We can only do 'optimal' * routing if data is going to go to all nodes in a group. */ if (triggerRouter.getRouter().getNodeGroupLink().getSourceNodeGroupId().equals(nodeGroupId)) { if (!isDefaultRouter) { producesCommonBatches = false; break; } else { if (triggerRouter.getTrigger().isSyncOnIncomingBatch()) { String outgoingTableName = triggerRouter.getTrigger() .getFullyQualifiedSourceTableName(); for (TriggerRouter triggerRouter2 : testableTriggerRouters) { String incomingTableName = triggerRouter2.getTrigger() .getFullyQualifiedSourceTableName(); String targetNodeGroupId = triggerRouter2.getRouter().getNodeGroupLink() .getTargetNodeGroupId(); if (incomingTableName.equals(outgoingTableName) && targetNodeGroupId.equals(nodeGroupId)) { producesCommonBatches = false; break; } } } } } } } if (!producesCommonBatches.equals(commonBatchesLastKnownState.get(channelId))) { if (producesCommonBatches) { log.info("The '{}' channel is in common batch mode", channelId); } else { log.info("The '{}' channel is NOT in common batch mode", channelId); } commonBatchesLastKnownState.put(channelId, producesCommonBatches); } return producesCommonBatches; }
From source file:mondrian.test.SchemaTest.java
public void testDimensionUsageVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<Cube name=\"Foo\">\n" + " <Table name=\"store\"/>\n" + " <Dimension name=\"Bacon\">\n" + " <Hierarchy hasAll=\"true\">\n" + " <Level name=\"Store Type\" column=\"store_type\" uniqueMembers=\"true\"/>\n" + " </Hierarchy>\n" + " </Dimension>\n" + " <Measure name=\"Store Sqft\" column=\"store_sqft\" aggregator=\"sum\"\n" + " formatString=\"#,###\"/>\n" + "</Cube>\n"; final TestContext context = TestContext.instance().create(null, cubeDef, null, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); String dimensionDef = "<DimensionUsage name=\"Bar\" source=\"Time\" foreignKey=\"time_id\" visible=\"@REPLACE_ME@\"/>"; dimensionDef = dimensionDef.replace("@REPLACE_ME@", String.valueOf(testValue)); context.getConnection().getSchema().createDimension(cube, dimensionDef); Dimension dim = null;/* w ww . ja v a 2s. c o m*/ for (Dimension dimCheck : cube.getDimensions()) { if (dimCheck.getName().equals("Bar")) { dim = dimCheck; } } assertNotNull(dim); assertTrue(testValue.equals(dim.isVisible())); } }
From source file:mondrian.test.SchemaTest.java
public void testHierarchyVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<Cube name=\"Foo\">\n" + " <Table name=\"store\"/>\n" + " <Dimension name=\"Bar\">\n" + " <Hierarchy name=\"Bacon\" hasAll=\"true\" visible=\"@REPLACE_ME@\">\n" + " <Level name=\"Store Type\" column=\"store_type\" uniqueMembers=\"true\"/>\n" + " </Hierarchy>\n" + " </Dimension>\n" + " <Measure name=\"Store Sqft\" column=\"store_sqft\" aggregator=\"sum\"\n" + " formatString=\"#,###\"/>\n" + "</Cube>\n"; cubeDef = cubeDef.replace("@REPLACE_ME@", String.valueOf(testValue)); final TestContext context = TestContext.instance().create(null, cubeDef, null, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); Dimension dim = null;//from ww w . j a v a 2 s.c o m for (Dimension dimCheck : cube.getDimensions()) { if (dimCheck.getName().equals("Bar")) { dim = dimCheck; } } assertNotNull(dim); final Hierarchy hier = dim.getHierarchy(); assertNotNull(hier); assertEquals(MondrianProperties.instance().SsasCompatibleNaming.get() ? "Bacon" : "Bar.Bacon", hier.getName()); assertTrue(testValue.equals(hier.isVisible())); } }
From source file:mondrian.test.SchemaTest.java
public void testLevelVisibility() throws Exception { for (Boolean testValue : new Boolean[] { true, false }) { String cubeDef = "<Cube name=\"Foo\">\n" + " <Table name=\"store\"/>\n" + " <Dimension name=\"Bar\">\n" + " <Hierarchy name=\"Bacon\" hasAll=\"false\">\n" + " <Level name=\"Samosa\" column=\"store_type\" uniqueMembers=\"true\" visible=\"@REPLACE_ME@\"/>\n" + " </Hierarchy>\n" + " </Dimension>\n" + " <Measure name=\"Store Sqft\" column=\"store_sqft\" aggregator=\"sum\"\n" + " formatString=\"#,###\"/>\n" + "</Cube>\n"; cubeDef = cubeDef.replace("@REPLACE_ME@", String.valueOf(testValue)); final TestContext context = TestContext.instance().create(null, cubeDef, null, null, null, null); final Cube cube = context.getConnection().getSchema().lookupCube("Foo", true); Dimension dim = null;/* ww w. j a v a 2 s.c o m*/ for (Dimension dimCheck : cube.getDimensions()) { if (dimCheck.getName().equals("Bar")) { dim = dimCheck; } } assertNotNull(dim); final Hierarchy hier = dim.getHierarchy(); assertNotNull(hier); assertEquals(MondrianProperties.instance().SsasCompatibleNaming.get() ? "Bacon" : "Bar.Bacon", hier.getName()); final mondrian.olap.Level level = hier.getLevels()[0]; assertEquals("Samosa", level.getName()); assertTrue(testValue.equals(level.isVisible())); } }
From source file:com.evolveum.polygon.scim.StandardScimHandlingStrategy.java
@Override public Map<String, Map<String, Object>> parseSchemaAttribute(JSONObject attribute, Map<String, Map<String, Object>> attributeMap, ParserSchemaScim parser) { String attributeName = null;/* w w w .j ava 2s . c o m*/ Boolean isComplex = false; Boolean isMultiValued = false; Boolean hasSubAttributes = false; String nameFromDictionary = ""; Map<String, Object> attributeObjects = new HashMap<String, Object>(); Map<String, Object> subAttributeMap = new HashMap<String, Object>(); List<String> dictionary = populateDictionary(WorkaroundFlags.PARSERFLAG); List<String> excludedAttributes = defineExcludedAttributes(); for (int position = 0; position < dictionary.size(); position++) { nameFromDictionary = dictionary.get(position); if (attribute.has(nameFromDictionary)) { hasSubAttributes = true; break; } } if (hasSubAttributes) { boolean hasTypeValues = false; JSONArray subAttributes = new JSONArray(); subAttributes = (JSONArray) attribute.get(nameFromDictionary); if (attributeName == null) { for (String subAttributeNameKeys : attribute.keySet()) { if (NAME.equals(subAttributeNameKeys)) { attributeName = attribute.get(subAttributeNameKeys).toString(); if (attributeName.contains(FORBIDENSEPPARATOR)) { attributeName = attributeName.replace(FORBIDENSEPPARATOR, SEPPARATOR); } break; } } } if (!excludedAttributes.contains(attributeName)) { for (String nameKey : attribute.keySet()) { if (MULTIVALUED.equals(nameKey)) { isMultiValued = (Boolean) attribute.get(nameKey); break; } } for (int i = 0; i < subAttributes.length(); i++) { JSONObject subAttribute = new JSONObject(); subAttribute = subAttributes.getJSONObject(i); subAttributeMap = parser.parseSubAttribute(subAttribute, subAttributeMap); } for (String typeKey : subAttributeMap.keySet()) { if (TYPE.equals(typeKey)) { hasTypeValues = true; break; } } if (hasTypeValues) { Map<String, Object> typeObject = new HashMap<String, Object>(); typeObject = (HashMap<String, Object>) subAttributeMap.get(TYPE); if (typeObject.containsKey(CANONICALVALUES) || typeObject.containsKey(REFERENCETYPES)) { JSONArray referenceValues = new JSONArray(); if (typeObject.containsKey(CANONICALVALUES)) { referenceValues = (JSONArray) typeObject.get(CANONICALVALUES); } else { referenceValues = (JSONArray) typeObject.get(REFERENCETYPES); } for (int position = 0; position < referenceValues.length(); position++) { Map<String, Object> processedParameters = translateReferenceValues(attributeMap, referenceValues, subAttributeMap, position, attributeName); for (String parameterName : processedParameters.keySet()) { if (ISCOMPLEX.equals(parameterName)) { isComplex = (Boolean) processedParameters.get(parameterName); } else { attributeMap = (Map<String, Map<String, Object>>) processedParameters .get(parameterName); } } } } else { // default set of canonical values. List<String> defaultReferenceTypeValues = new ArrayList<String>(); defaultReferenceTypeValues.add("User"); defaultReferenceTypeValues.add("Group"); defaultReferenceTypeValues.add("external"); defaultReferenceTypeValues.add(URI); for (String subAttributeKeyNames : subAttributeMap.keySet()) { if (!TYPE.equals(subAttributeKeyNames)) { for (String defaultTypeReferenceValues : defaultReferenceTypeValues) { StringBuilder complexAttrName = new StringBuilder(attributeName); complexAttrName.append(DOT).append(defaultTypeReferenceValues); attributeMap.put( complexAttrName.append(DOT).append(subAttributeKeyNames).toString(), (HashMap<String, Object>) subAttributeMap.get(subAttributeKeyNames)); isComplex = true; } } } } } else { if (!isMultiValued) { for (String subAttributeKeyNames : subAttributeMap.keySet()) { StringBuilder complexAttrName = new StringBuilder(attributeName); attributeMap.put(complexAttrName.append(DOT).append(subAttributeKeyNames).toString(), (HashMap<String, Object>) subAttributeMap.get(subAttributeKeyNames)); isComplex = true; } } else { for (String subAttributeKeyNames : subAttributeMap.keySet()) { StringBuilder complexAttrName = new StringBuilder(attributeName); Map<String, Object> subattributeKeyMap = (HashMap<String, Object>) subAttributeMap .get(subAttributeKeyNames); for (String attributeProperty : subattributeKeyMap.keySet()) { if (MULTIVALUED.equals(attributeProperty)) { subattributeKeyMap.put(MULTIVALUED, true); } } attributeMap.put(complexAttrName.append(DOT).append(DEFAULT).append(DOT) .append(subAttributeKeyNames).toString(), subattributeKeyMap); isComplex = true; } } } } } else { for (String attributeNameKeys : attribute.keySet()) { if (!excludedAttributes.contains(attributeName)) { if (NAME.equals(attributeNameKeys)) { attributeName = attribute.get(attributeNameKeys).toString(); if (attributeName.contains(FORBIDENSEPPARATOR)) { attributeName = attributeName.replace(FORBIDENSEPPARATOR, SEPPARATOR); } } else { attributeObjects.put(attributeNameKeys, attribute.get(attributeNameKeys)); } } else { if (!attributeObjects.isEmpty()) { attributeObjects.clear(); } } } } if (!isComplex) { if (!attributeObjects.isEmpty()) { attributeMap.put(attributeName, attributeObjects); } } return attributeMap; }