public NSArray sectionsContents() { NSArray result = ((ERMDListPageRepetition) parent()).sectionsContents(); if (result.count() == 1) { return result; } if (result.count() == 0) { return NSArray.EmptyArray; } ERD2WContainer pair = (ERD2WContainer) result.objectAtIndex(0); return new NSArray(pair); }
private void computeRecordValuesForRecords(NSArray recs) { Enumeration anEnum = recs.objectEnumerator(); while (anEnum.hasMoreElements()) { DRRecord rec = (DRRecord)anEnum.nextElement(); rec.populateValueList(); } }
public int displayLevelForEvent(EOEvent e) { int index, i, n; NSArray children; index = selectionPath.indexOfObject(e); if (index != NSArray.NotFound) return index; children = rootEventList(); if (children.containsObject(e)) return 0; int count = selectionPath.count(); for (i = 0, n = count; i < n; i++) { children = (NSArray)cache.objectForKey(selectionPath.objectAtIndex(i)); if (null==children) break; if (children.containsObject(e)) return i+1; } return -1; }
public NSArray<String> reasonLines() { if (null==_reasonLines) { String aMessage = exception.getMessage(); if (aMessage!=null) { _reasonLines = NSArray.componentsSeparatedByString(exception.getMessage(), "\n"); } else { _reasonLines = new NSArray<>(); } } return _reasonLines; }
public String confirmJSMessage() { String theMessage = (String)_WOJExtensionsUtil.valueForBindingOrNull("confirmMessage",this); // Put in a default message if one was not provided if (theMessage==null) { theMessage = "Are you sure you want to do this?"; } else { // Strip out the tags in the message that will mess things up - like apostrophes and quotes theMessage = NSArray.componentsSeparatedByString(theMessage, "'").componentsJoinedByString(""); theMessage = NSArray.componentsSeparatedByString(theMessage, "\"").componentsJoinedByString(""); } // Return the opening string for the Javascript function return "return confirm('"+theMessage+"')"; } }
private String parseDateRangeString(String dateRange) { String result = ""; if (dateRange.indexOf(":") > 0) { NSArray<String> components = NSArray.componentsSeparatedByString(dateRange, ":"); String firstDate = "'" + components.objectAtIndex(0) + "'"; String lastDate = components.objectAtIndex(1); if (!lastDate.equals("1")) lastDate = "'" + lastDate + "'"; result = "{" + firstDate + ":" + lastDate + "}"; } else { result = "{'" + dateRange + "':1}" ; } return result; }
boolean isPrimaryKeyAttributes(EOEntity entity, NSArray<EOAttribute> attributes) { NSArray<String> keys = entity.primaryKeyAttributeNames(); boolean result = attributes.count() == keys.count(); if (result) { for (int i = 0; i < keys.count(); i++) { if (!(result = keys.indexOfObject(attributes.objectAtIndex(i).name()) != NSArray.NotFound)) break; } } return result; }
public EOSortOrdering _primaryOrdering() { NSArray anArray = _sortOrderingArray(); if (anArray.count() > 0) { EOSortOrdering anOrdering = (EOSortOrdering)anArray.objectAtIndex(0); return anOrdering; } return null; }
/** * Utility that traverses a key path to find the last destination entity * * @param keyPath the key path * @return the entity at the end of the keypath */ private EOEntity entityForKeyPath(String keyPath) { NSArray<String> keys = NSArray.componentsSeparatedByString(keyPath, "."); EOEntity ent = entity(); for (int i = 0; i < keys.count(); i++) { String k = keys.objectAtIndex(i); EORelationship rel = ent.anyRelationshipNamed(k); if (rel == null) { // it may be an attribute if (ent.anyAttributeNamed(k) != null) { break; } throw new IllegalArgumentException("relationship " + keyPath + " generated null"); } ent = rel.destinationEntity(); } return ent; }
public EOEntity entityWithEntityAndKeyPath(EOEntity entity, String keyPath) { NSArray keys = NSArray.componentsSeparatedByString(keyPath, "."); Enumeration keysEnumerator = keys.objectEnumerator(); String key = null; EOEntity result = entity; while (keysEnumerator.hasMoreElements()) { key = (String) keysEnumerator.nextElement(); result = result.relationshipNamed(key).destinationEntity(); } return result; }
public void setToAddressesAsArray(NSArray toAddresses) { if (toAddresses != null && toAddresses.count() > 0) { setToAddresses(toAddresses.componentsJoinedByString(AddressSeparator)); } }
public boolean nototals() { if (totals().count() > 0) { return false; } return true; }
public int numberOfCrits() { int nm = 1; Enumeration en = model().hList().objectEnumerator(); //log.debug( "this.model().hList():"+this.model().hList()); while (en.hasMoreElements()) { DRGroup grp = (DRGroup)en.nextElement(); nm = nm*grp.sortedCriteriaList().count(); } //log.debug( "nm:"+nm); return nm; }
public NSArray recordsForRawRecords(NSArray rawr) { NSMutableArray recs = new NSMutableArray(); Enumeration anEnum = rawr.objectEnumerator(); while (anEnum.hasMoreElements()) { NSKeyValueCodingAdditions rawrec = (NSKeyValueCodingAdditions)anEnum.nextElement(); recs.addObject(DRRecord.withRawRecordModel(rawrec, this)); } return new NSArray(recs); }
@Override public NSArray<EOSQLExpression> dropTableStatementsForEntityGroup(NSArray<EOEntity> entityGroup) { String tableName = entityGroup.objectAtIndex(0).externalName(); return new NSArray<EOSQLExpression>(_expressionForString("DROP TABLE " + formatTableName(tableName))); }
public static String morphedSchedulingStartDay(Integer value) { if (value != null) { Object aString = MObject.weekArray.objectAtIndex(value.intValue()); if (aString != null) { return aString.toString(); } } return null; }
/** * Validates the given sort key (is it a display key, an attribute, or a valid attribute path). * * @param displayPropertyKeys the current display properties * @param sortKey the sort key to validate * @return true if the sort key is valid, false if not */ protected boolean isValidSortKey(NSArray<String> displayPropertyKeys, String sortKey) { boolean validSortOrdering = false; try { if (displayPropertyKeys.containsObject(sortKey) || entity().anyAttributeNamed(sortKey) != null || ERXEOAccessUtilities.attributePathForKeyPath(entity(), sortKey).count() > 0) { validSortOrdering = true; } } catch (IllegalArgumentException e) { // MS: ERXEOAccessUtilities.attributePathForKeyPath throws IllegalArgumentException for a bogus key path validSortOrdering = false; } if (!validSortOrdering) { log.warn("Sort key '" + sortKey + "' is not in display keys, attributes or non-flattened key paths for the entity '" + entity().name() + "'."); validSortOrdering = false; } return validSortOrdering; }
public void deleteAllPartial_EmployeePersonsRelationships() { Enumeration objects = partial_EmployeePersons().immutableClone().objectEnumerator(); while (objects.hasMoreElements()) { deletePartial_EmployeePersonsRelationship((er.example.erxpartials.model.Person)objects.nextElement()); } }