Processes a row of the sites table and stores the site information found
therein.

@param siteRow
string serialisation of a sites table row as found in the SQL
dump
349953
void processSiteRow(String siteRow) {
		String[] row = getSiteRowFields(siteRow);

		String filePath = "";
		String pagePath = "";

		String dataArray = row[8].substring(row[8].indexOf('{'),
				row[8].length() - 2);

		// Explanation for the regular expression below:
		// "'{' or ';'" followed by either
		// "NOT: ';', '{', or  '}'" repeated one or more times; or
		// "a single '}'"
		// The first case matches ";s:5:\"paths\""
		// but also ";a:2:" in "{s:5:\"paths\";a:2:{s:9:\ ...".
		// The second case matches ";}" which terminates (sub)arrays.
		Matcher matcher = Pattern.compile("[{;](([^;}{][^;}{]*)|[}])").matcher(
				dataArray);
		String prevString = "";
		String curString = "";
		String path = "";
		boolean valuePosition = false;

		while (matcher.find()) {
			String match = matcher.group().substring(1);
			if (match.length() == 0) {
				valuePosition = false;
				continue;
			}
			if (match.charAt(0) == 's') {
				valuePosition = !valuePosition && !"".equals(prevString);
				curString = match.substring(match.indexOf('"') + 1,
						match.length() - 2);
			} else if (match.charAt(0) == 'a') {
				valuePosition = false;
				path = path + "/" + prevString;
			} else if ("}".equals(match)) {
				valuePosition = false;
				path = path.substring(0, path.lastIndexOf('/'));
			}

			if (valuePosition && "file_path".equals(prevString)
					&& "/paths".equals(path)) {
				filePath = curString;
			} else if (valuePosition && "page_path".equals(prevString)
					&& "/paths".equals(path)) {
				pagePath = curString;
			}

			prevString = curString;
			curString = "";
		}

		MwSitesDumpFileProcessor.logger.debug("Found site data \"" + row[1]
				+ "\" (group \"" + row[3] + "\", language \"" + row[5]
				+ "\", type \"" + row[2] + "\")");
		this.sites.setSiteInformation(row[1], row[3], row[5], row[2], filePath,
				pagePath);
	}
623240
protected void processDurationField(Row row)
   {
      processField(row, "DUR_FIELD_ID", "DUR_REF_UID", MPDUtility.getAdjustedDuration(m_project, row.getInt("DUR_VALUE"), MPDUtility.getDurationTimeUnits(row.getInt("DUR_FMT"))));
   }
324934
public void processCalendar(Row row)
   {
      ProjectCalendar calendar = m_project.addCalendar();

      Integer id = row.getInteger("clndr_id");
      m_calMap.put(id, calendar);
      calendar.setName(row.getString("clndr_name"));

      try
      {
         calendar.setMinutesPerDay(Integer.valueOf((int) NumberHelper.getDouble(row.getDouble("day_hr_cnt")) * 60));
         calendar.setMinutesPerWeek(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("week_hr_cnt")) * 60)));
         calendar.setMinutesPerMonth(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("month_hr_cnt")) * 60)));
         calendar.setMinutesPerYear(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("year_hr_cnt")) * 60)));
      }
      catch (ClassCastException ex)
      {
         // We have seen examples of malformed calendar data where fields have been missing
         // from the record. We'll typically get a class cast exception here as we're trying
         // to process something which isn't a double.
         // We'll just return at this point as it's not clear that we can salvage anything
         // sensible from this record.
         return;
      }

      // Process data
      String calendarData = row.getString("clndr_data");
      if (calendarData != null && !calendarData.isEmpty())
      {
         Record root = Record.getRecord(calendarData);
         if (root != null)
         {
            processCalendarDays(calendar, root);
            processCalendarExceptions(calendar, root);
         }
      }
      else
      {
         // if there is not DaysOfWeek data, Primavera seems to default to Mon-Fri, 8:00-16:00
         DateRange defaultHourRange = new DateRange(DateHelper.getTime(8, 0), DateHelper.getTime(16, 0));
         for (Day day : Day.values())
         {
            if (day != Day.SATURDAY && day != Day.SUNDAY)
            {
               calendar.setWorkingDay(day, true);
               ProjectCalendarHours hours = calendar.addCalendarHours(day);
               hours.addRange(defaultHourRange);
            }
            else
            {
               calendar.setWorkingDay(day, false);
            }
         }
      }

      m_eventManager.fireCalendarReadEvent(calendar);
   }
748371
private void processResource(MapRow row) throws IOException
   {
      Resource resource = m_project.addResource();
      resource.setName(row.getString("NAME"));
      resource.setGUID(row.getUUID("UUID"));
      resource.setEmailAddress(row.getString("EMAIL"));
      resource.setHyperlink(row.getString("URL"));
      resource.setNotes(getNotes(row.getRows("COMMENTARY")));
      resource.setText(1, row.getString("DESCRIPTION"));
      resource.setText(2, row.getString("SUPPLY_REFERENCE"));
      resource.setActive(true);

      List<MapRow> resources = row.getRows("RESOURCES");
      if (resources != null)
      {
         for (MapRow childResource : sort(resources, "NAME"))
         {
            processResource(childResource);
         }
      }

      m_resourceMap.put(resource.getGUID(), resource);
   }
441496
public void processResources(List<Row> rows)
   {
      for (Row row : rows)
      {
         Resource resource = m_project.addResource();
         processFields(m_resourceFields, row, resource);
         resource.setResourceCalendar(getResourceCalendar(row.getInteger("clndr_id")));

         // Even though we're not filling in a rate, filling in a time unit can still be useful
         // so that we know what rate time unit was originally used in Primavera.
         TimeUnit timeUnit = TIME_UNIT_MAP.get(row.getString("cost_qty_type"));
         resource.setStandardRateUnits(timeUnit);
         resource.setOvertimeRateUnits(timeUnit);

         // Add User Defined Fields
         populateUserDefinedFieldValues("RSRC", FieldTypeClass.RESOURCE, resource, resource.getUniqueID());

         m_eventManager.fireResourceReadEvent(resource);
      }
   }
745750
@Override
	protected String[] getRow(String[] resultRow) {
		return Arrays.copyOfRange(resultRow, 1, resultRow.length);
	}
712645
private void processResources() throws SQLException
   {
      List<Row> rows = getRows("select * from " + m_schema + "rsrc where delete_date is null and rsrc_id in (select rsrc_id from " + m_schema + "taskrsrc t where proj_id=? and delete_date is null) order by rsrc_seq_num", m_projectID);
      m_reader.processResources(rows);
   }
242214
protected void processProjectListItem(Map<Integer, String> result, Row row)
   {
      Integer id = row.getInteger("PROJ_ID");
      String name = row.getString("PROJ_NAME");
      result.put(id, name);
   }
664629
public void write(Iterable<?> row) throws IOException {
      if (row != null) {
         writer.write(formatter.format(row));
      }
      writer.write(SystemInfo.LINE_SEPARATOR);
   }
68236
public final void ensureRowsComplete() throws SnowflakeSQLException
  {
    // Check that all the rows have been decoded, raise an error if not
    if (rowCount != currentRow)
    {
      throw
          new SnowflakeSQLException(
              SqlState.INTERNAL_ERROR,
              ErrorCode.INTERNAL_ERROR
                  .getMessageCode(),
              "Exception: expected " +
              rowCount +
              " rows and received " +
              currentRow);
    }
  }
641534
private void processResources() throws SQLException
   {
      List<Row> permanentRows = getRows("select * from permanent_resource where projid=? order by permanent_resourceid", m_projectID);
      List<Row> consumableRows = getRows("select * from consumable_resource where projid=? order by consumable_resourceid", m_projectID);
      m_reader.processResources(permanentRows, consumableRows);
   }
738127
function processRow(row) {
        if (!row) row = {};
        for (var i = 0; i < hooks.length; i++) {
            if (hooks[i].call(row, req, row) === true) return false;
        }
        return true;
    }
865965
@Override
    public void persistRows(Map<HTableInterface, List<HBaseDataWrapper>> rows) throws IOException
    {
        List<Put> dataSet = new ArrayList<Put>(rows.size());
        for (HTableInterface hTable : rows.keySet())
        {
            List<HBaseDataWrapper> row = rows.get(hTable);
            for (HBaseDataWrapper data : row)
            {
                dataSet.add(preparePut(data.getColumnFamily(), data.getRowKey(), data.getColumns(), data.getValues()));
            }
            hTable.put(dataSet);
            dataSet.clear();
        }
    }
612038
protected void processAssignmentBaseline(Row row)
   {
      Integer id = row.getInteger("ASSN_UID");
      ResourceAssignment assignment = m_assignmentMap.get(id);
      if (assignment != null)
      {
         int index = row.getInt("AB_BASE_NUM");

         assignment.setBaselineStart(index, row.getDate("AB_BASE_START"));
         assignment.setBaselineFinish(index, row.getDate("AB_BASE_FINISH"));
         assignment.setBaselineWork(index, row.getDuration("AB_BASE_WORK"));
         assignment.setBaselineCost(index, row.getCurrency("AB_BASE_COST"));
      }
   }
426509
public void processProjectProperties(Row row)
   {
      ProjectProperties ph = m_project.getProjectProperties();
      ph.setDuration(row.getDuration("DURATIONHOURS"));
      ph.setStartDate(row.getDate("STARU"));
      ph.setFinishDate(row.getDate("ENE"));
      ph.setName(row.getString("SHORT_NAME"));
      ph.setAuthor(row.getString("PROJECT_BY"));
      //DURATION_TIME_UNIT
      ph.setLastSaved(row.getDate("LAST_EDITED_DATE"));
   }
830864
function _processPages(siteDesc, prefix) {
    if (siteDesc.pages !== undefined && siteDesc.pages !== null) {
        //console.log('pages', siteDesc.pages, 'prefix', prefix);

        for (let i in siteDesc.pages) {
            _processElement(siteDesc.pages[i], prefix);
        }
    }
}
949041
private void processTasks() throws SQLException
   {
      List<Row> bars = getRows("select * from bar where projid=?", m_projectID);
      List<Row> expandedTasks = getRows("select * from expanded_task where projid=?", m_projectID);
      List<Row> tasks = getRows("select * from task where projid=?", m_projectID);
      List<Row> milestones = getRows("select * from milestone where projid=?", m_projectID);
      m_reader.processTasks(bars, expandedTasks, tasks, milestones);
   }