idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
143,900
private Layout getActiveLayout ( Project phoenixProject ) { Layout activeLayout = phoenixProject . getLayouts ( ) . getLayout ( ) . get ( 0 ) ; if ( ! activeLayout . isActive ( ) . booleanValue ( ) ) { for ( Layout layout : phoenixProject . getLayouts ( ) . getLayout ( ) ) { if ( layout . isActive ( ) . booleanValue ( ...
Find the current active layout .
143,901
private void processActivities ( Storepoint phoenixProject ) { final AlphanumComparator comparator = new AlphanumComparator ( ) ; List < Activity > activities = phoenixProject . getActivities ( ) . getActivity ( ) ; Collections . sort ( activities , new Comparator < Activity > ( ) { public int compare ( Activity o1 , A...
Process the set of activities from the Phoenix file .
143,902
private void processActivity ( Activity activity ) { Task task = getParentTask ( activity ) . addTask ( ) ; task . setText ( 1 , activity . getId ( ) ) ; task . setActualDuration ( activity . getActualDuration ( ) ) ; task . setActualFinish ( activity . getActualFinish ( ) ) ; task . setActualStart ( activity . getActu...
Create a Task instance from a Phoenix activity .
143,903
private boolean activityIsMilestone ( Activity activity ) { String type = activity . getType ( ) ; return type != null && type . indexOf ( "Milestone" ) != - 1 ; }
Returns true if the activity is a milestone .
143,904
private boolean activityIsStartMilestone ( Activity activity ) { String type = activity . getType ( ) ; return type != null && type . indexOf ( "StartMilestone" ) != - 1 ; }
Returns true if the activity is a start milestone .
143,905
private ChildTaskContainer getParentTask ( Activity activity ) { Map < UUID , UUID > map = getActivityCodes ( activity ) ; ChildTaskContainer parent = m_projectFile ; StringBuilder uniqueIdentifier = new StringBuilder ( ) ; for ( UUID activityCode : m_codeSequence ) { UUID activityCodeValue = map . get ( activityCode )...
Retrieves the parent task for a Phoenix activity .
143,906
private Task findChildTaskByUUID ( ChildTaskContainer parent , UUID uuid ) { Task result = null ; for ( Task task : parent . getChildTasks ( ) ) { if ( uuid . equals ( task . getGUID ( ) ) ) { result = task ; break ; } } return result ; }
Locates a task within a child task container which matches the supplied UUID .
143,907
private void readAssignments ( Resource mpxjResource , net . sf . mpxj . phoenix . schema . Project . Storepoints . Storepoint . Resources . Resource res ) { for ( Assignment assignment : res . getAssignment ( ) ) { readAssignment ( mpxjResource , assignment ) ; } }
Reads Phoenix resource assignments .
143,908
private void readAssignment ( Resource resource , Assignment assignment ) { Task task = m_activityMap . get ( assignment . getActivity ( ) ) ; if ( task != null ) { task . addResourceAssignment ( resource ) ; } }
Read a single resource assignment .
143,909
private void readRelationships ( Storepoint phoenixProject ) { for ( Relationship relation : phoenixProject . getRelationships ( ) . getRelationship ( ) ) { readRelation ( relation ) ; } }
Read task relationships from a Phoenix file .
143,910
private void readRelation ( Relationship relation ) { Task predecessor = m_activityMap . get ( relation . getPredecessor ( ) ) ; Task successor = m_activityMap . get ( relation . getSuccessor ( ) ) ; if ( predecessor != null && successor != null ) { Duration lag = relation . getLag ( ) ; RelationType type = relation . ...
Read an individual Phoenix task relationship .
143,911
Map < UUID , UUID > getActivityCodes ( Activity activity ) { Map < UUID , UUID > map = m_activityCodeCache . get ( activity ) ; if ( map == null ) { map = new HashMap < UUID , UUID > ( ) ; m_activityCodeCache . put ( activity , map ) ; for ( CodeAssignment ca : activity . getCodeAssignment ( ) ) { UUID code = getUUID (...
For a given activity retrieve a map of the activity code values which have been assigned to it .
143,912
private Storepoint getCurrentStorepoint ( Project phoenixProject ) { List < Storepoint > storepoints = phoenixProject . getStorepoints ( ) . getStorepoint ( ) ; Collections . sort ( storepoints , new Comparator < Storepoint > ( ) { public int compare ( Storepoint o1 , Storepoint o2 ) { return DateHelper . compare ( o2 ...
Retrieve the most recent storepoint .
143,913
public TableReader read ( ) throws IOException { int tableHeader = m_stream . readInt ( ) ; if ( tableHeader != 0x39AF547A ) { throw new IllegalArgumentException ( "Unexpected file format" ) ; } int recordCount = m_stream . readInt ( ) ; for ( int loop = 0 ; loop < recordCount ; loop ++ ) { int rowMagicNumber = m_strea...
Read data from the table . Return a reference to the current instance to allow method chaining .
143,914
protected void readUUID ( StreamReader stream , Map < String , Object > map ) throws IOException { int unknown0Size = stream . getMajorVersion ( ) > 5 ? 8 : 16 ; map . put ( "UNKNOWN0" , stream . readBytes ( unknown0Size ) ) ; map . put ( "UUID" , stream . readUUID ( ) ) ; }
Read the optional row header and UUID .
143,915
protected int readShort ( int offset , byte [ ] data ) { int result = 0 ; int i = offset + m_offset ; for ( int shiftBy = 0 ; shiftBy < 16 ; shiftBy += 8 ) { result |= ( ( data [ i ] & 0xff ) ) << shiftBy ; ++ i ; } return result ; }
Read a two byte integer from the data .
143,916
public void loadObject ( Object object , Set < String > excludedMethods ) { m_model . setTableModel ( createTableModel ( object , excludedMethods ) ) ; }
Populate the model with the object s properties .
143,917
private TableModel createTableModel ( Object object , Set < String > excludedMethods ) { List < Method > methods = new ArrayList < Method > ( ) ; for ( Method method : object . getClass ( ) . getMethods ( ) ) { if ( ( method . getParameterTypes ( ) . length == 0 ) || ( method . getParameterTypes ( ) . length == 1 && me...
Create a table model from an object s properties .
143,918
private Object filterValue ( Object value ) { if ( value instanceof Boolean && ! ( ( Boolean ) value ) . booleanValue ( ) ) { value = null ; } if ( value instanceof String && ( ( String ) value ) . isEmpty ( ) ) { value = null ; } if ( value instanceof Double && ( ( Double ) value ) . doubleValue ( ) == 0.0 ) { value =...
Replace default values will null allowing them to be ignored .
143,919
private void getSingleValue ( Method method , Object object , Map < String , String > map ) { Object value ; try { value = filterValue ( method . invoke ( object ) ) ; } catch ( Exception ex ) { value = ex . toString ( ) ; } if ( value != null ) { map . put ( getPropertyName ( method ) , String . valueOf ( value ) ) ; ...
Retrieve a single value property .
143,920
private void getMultipleValues ( Method method , Object object , Map < String , String > map ) { try { int index = 1 ; while ( true ) { Object value = filterValue ( method . invoke ( object , Integer . valueOf ( index ) ) ) ; if ( value != null ) { map . put ( getPropertyName ( method , index ) , String . valueOf ( val...
Retrieve multiple properties .
143,921
private String getPropertyName ( Method method ) { String result = method . getName ( ) ; if ( result . startsWith ( "get" ) ) { result = result . substring ( 3 ) ; } return result ; }
Convert a method name into a property name .
143,922
public void setLocale ( Locale locale ) { List < SimpleDateFormat > formats = new ArrayList < SimpleDateFormat > ( ) ; for ( SimpleDateFormat format : m_formats ) { formats . add ( new SimpleDateFormat ( format . toPattern ( ) , locale ) ) ; } m_formats = formats . toArray ( new SimpleDateFormat [ formats . size ( ) ] ...
This method is called when the locale of the parent file is updated . It resets the locale specific date attributes to the default values for the new locale .
143,923
public Map < String , Table > process ( File directory , String prefix ) throws IOException { String filePrefix = prefix . toUpperCase ( ) ; Map < String , Table > tables = new HashMap < String , Table > ( ) ; File [ ] files = directory . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { String name = ...
Main entry point . Reads a directory containing a P3 Btrieve database files and returns a map of table names and table content .
143,924
public static void openLogFile ( ) throws IOException { if ( LOG_FILE != null ) { System . out . println ( "SynchroLogger Configured" ) ; LOG = new PrintWriter ( new FileWriter ( LOG_FILE ) ) ; } }
Open the log file for writing .
143,925
public static void log ( String label , byte [ ] data ) { if ( LOG != null ) { LOG . write ( label ) ; LOG . write ( ": " ) ; LOG . println ( ByteArrayHelper . hexdump ( data , true ) ) ; LOG . flush ( ) ; } }
Log a byte array .
143,926
public static void log ( String label , String data ) { if ( LOG != null ) { LOG . write ( label ) ; LOG . write ( ": " ) ; LOG . println ( data ) ; LOG . flush ( ) ; } }
Log a string .
143,927
public static void log ( byte [ ] data ) { if ( LOG != null ) { LOG . println ( ByteArrayHelper . hexdump ( data , true , 16 , "" ) ) ; LOG . flush ( ) ; } }
Log a byte array as a hex dump .
143,928
public static void log ( String label , Class < ? > klass , Map < String , Object > map ) { if ( LOG != null ) { LOG . write ( label ) ; LOG . write ( ": " ) ; LOG . println ( klass . getSimpleName ( ) ) ; for ( Map . Entry < String , Object > entry : map . entrySet ( ) ) { LOG . println ( entry . getKey ( ) + ": " + e...
Log table contents .
143,929
public void setValue ( FieldContainer container , byte [ ] data ) { if ( data != null ) { container . set ( m_type , ( ( MPPUtility . getInt ( data , m_offset ) & m_mask ) == 0 ) ? m_zeroValue : m_nonZeroValue ) ; } }
Extracts the value of this bit flag from the supplied byte array and sets the value in the supplied container .
143,930
private void setFieldType ( FastTrackTableType tableType ) { switch ( tableType ) { case ACTBARS : { m_type = ActBarField . getInstance ( m_header . getColumnType ( ) ) ; break ; } case ACTIVITIES : { m_type = ActivityField . getInstance ( m_header . getColumnType ( ) ) ; break ; } case RESOURCES : { m_type = ResourceF...
Set the enum representing the type of this column .
143,931
public void process ( File file ) throws Exception { openLogFile ( ) ; int blockIndex = 0 ; int length = ( int ) file . length ( ) ; m_buffer = new byte [ length ] ; FileInputStream is = new FileInputStream ( file ) ; try { int bytesRead = is . read ( m_buffer ) ; if ( bytesRead != length ) { throw new RuntimeException...
Read a FastTrack file .
143,932
public FastTrackTable getTable ( FastTrackTableType type ) { FastTrackTable result = m_tables . get ( type ) ; if ( result == null ) { result = EMPTY_TABLE ; } return result ; }
Retrieve a table of data .
143,933
private void readBlock ( int blockIndex , int startIndex , int blockLength ) throws Exception { logBlock ( blockIndex , startIndex , blockLength ) ; if ( blockLength < 128 ) { readTableBlock ( startIndex , blockLength ) ; } else { readColumnBlock ( startIndex , blockLength ) ; } }
Read a block of data from the FastTrack file and determine if it contains a table definition or columns .
143,934
private void readTableBlock ( int startIndex , int blockLength ) { for ( int index = startIndex ; index < ( startIndex + blockLength - 11 ) ; index ++ ) { if ( matchPattern ( TABLE_BLOCK_PATTERNS , index ) ) { int offset = index + 7 ; int nameLength = FastTrackUtility . getInt ( m_buffer , offset ) ; offset += 4 ; Stri...
Read the name of a table and prepare to populate it with column data .
143,935
private void readColumnBlock ( int startIndex , int blockLength ) throws Exception { int endIndex = startIndex + blockLength ; List < Integer > blocks = new ArrayList < Integer > ( ) ; for ( int index = startIndex ; index < endIndex - 11 ; index ++ ) { if ( matchChildBlock ( index ) ) { int childBlockStart = index - 2 ...
Read multiple columns from a block .
143,936
private void readColumn ( int startIndex , int length ) throws Exception { if ( m_currentTable != null ) { int value = FastTrackUtility . getByte ( m_buffer , startIndex ) ; Class < ? > klass = COLUMN_MAP [ value ] ; if ( klass == null ) { klass = UnknownColumn . class ; } FastTrackColumn column = ( FastTrackColumn ) k...
Read data for a single column .
143,937
private final boolean matchPattern ( byte [ ] [ ] patterns , int bufferIndex ) { boolean match = false ; for ( byte [ ] pattern : patterns ) { int index = 0 ; match = true ; for ( byte b : pattern ) { if ( b != m_buffer [ bufferIndex + index ] ) { match = false ; break ; } ++ index ; } if ( match ) { break ; } } return...
Locate a feature in the file by match a byte pattern .
143,938
private final boolean matchChildBlock ( int bufferIndex ) { int index = 0 ; for ( byte b : CHILD_BLOCK_PATTERN ) { if ( b != m_buffer [ bufferIndex + index ] ) { return false ; } ++ index ; } int nameLength = FastTrackUtility . getInt ( m_buffer , bufferIndex + index ) ; return nameLength > 0 && nameLength < 100 ; }
Locate a child block by byte pattern and validate by checking the length of the string we are expecting to follow the pattern .
143,939
private void updateDurationTimeUnit ( FastTrackColumn column ) { if ( m_durationTimeUnit == null && isDurationColumn ( column ) ) { int value = ( ( DurationColumn ) column ) . getTimeUnitValue ( ) ; if ( value != 1 ) { m_durationTimeUnit = FastTrackUtility . getTimeUnit ( value ) ; } } }
Update the default time unit for durations based on data read from the file .
143,940
private void updateWorkTimeUnit ( FastTrackColumn column ) { if ( m_workTimeUnit == null && isWorkColumn ( column ) ) { int value = ( ( DurationColumn ) column ) . getTimeUnitValue ( ) ; if ( value != 1 ) { m_workTimeUnit = FastTrackUtility . getTimeUnit ( value ) ; } } }
Update the default time unit for work based on data read from the file .
143,941
private void logBlock ( int blockIndex , int startIndex , int blockLength ) { if ( m_log != null ) { m_log . println ( "Block Index: " + blockIndex ) ; m_log . println ( "Length: " + blockLength + " (" + Integer . toHexString ( blockLength ) + ")" ) ; m_log . println ( ) ; m_log . println ( FastTrackUtility . hexdump (...
Log block data .
143,942
private void logColumnData ( int startIndex , int length ) { if ( m_log != null ) { m_log . println ( ) ; m_log . println ( FastTrackUtility . hexdump ( m_buffer , startIndex , length , true , 16 , "" ) ) ; m_log . println ( ) ; m_log . flush ( ) ; } }
Log the data for a single column .
143,943
private void logUnexpectedStructure ( ) { if ( m_log != null ) { m_log . println ( "ABORTED COLUMN - unexpected structure: " + m_currentColumn . getClass ( ) . getSimpleName ( ) + " " + m_currentColumn . getName ( ) ) ; } }
Log unexpected column structure .
143,944
private void logColumn ( FastTrackColumn column ) { if ( m_log != null ) { m_log . println ( "TABLE: " + m_currentTable . getType ( ) ) ; m_log . println ( column . toString ( ) ) ; m_log . flush ( ) ; } }
Log column data .
143,945
private void populateCurrencySettings ( Record record , ProjectProperties properties ) { properties . setCurrencySymbol ( record . getString ( 0 ) ) ; properties . setSymbolPosition ( record . getCurrencySymbolPosition ( 1 ) ) ; properties . setCurrencyDigits ( record . getInteger ( 2 ) ) ; Character c = record . getCh...
Populates currency settings .
143,946
private void populateDefaultSettings ( Record record , ProjectProperties properties ) throws MPXJException { properties . setDefaultDurationUnits ( record . getTimeUnit ( 0 ) ) ; properties . setDefaultDurationIsFixed ( record . getNumericBoolean ( 1 ) ) ; properties . setDefaultWorkUnits ( record . getTimeUnit ( 2 ) )...
Populates default settings .
143,947
private void populateDateTimeSettings ( Record record , ProjectProperties properties ) { properties . setDateOrder ( record . getDateOrder ( 0 ) ) ; properties . setTimeFormat ( record . getTimeFormat ( 1 ) ) ; Date time = getTimeFromInteger ( record . getInteger ( 2 ) ) ; if ( time != null ) { properties . setDefaultS...
Populates date time settings .
143,948
private Date getTimeFromInteger ( Integer time ) { Date result = null ; if ( time != null ) { int minutes = time . intValue ( ) ; int hours = minutes / 60 ; minutes -= ( hours * 60 ) ; Calendar cal = DateHelper . popCalendar ( ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . se...
Converts a time represented as an integer to a Date instance .
143,949
private void populateProjectHeader ( Record record , ProjectProperties properties ) throws MPXJException { properties . setProjectTitle ( record . getString ( 0 ) ) ; properties . setCompany ( record . getString ( 1 ) ) ; properties . setManager ( record . getString ( 2 ) ) ; properties . setDefaultCalendarName ( recor...
Populates the project header .
143,950
private void populateCalendarHours ( Record record , ProjectCalendarHours hours ) throws MPXJException { hours . setDay ( Day . getInstance ( NumberHelper . getInt ( record . getInteger ( 0 ) ) ) ) ; addDateRange ( hours , record . getTime ( 1 ) , record . getTime ( 2 ) ) ; addDateRange ( hours , record . getTime ( 3 )...
Populates a calendar hours instance .
143,951
private void addDateRange ( ProjectCalendarHours hours , Date start , Date end ) { if ( start != null && end != null ) { Calendar cal = DateHelper . popCalendar ( end ) ; if ( cal . get ( Calendar . HOUR_OF_DAY ) == 0 && cal . get ( Calendar . MINUTE ) == 0 && cal . get ( Calendar . SECOND ) == 0 && cal . get ( Calenda...
Get a date range that correctly handles the case where the end time is midnight . In this instance the end time should be the start of the next day .
143,952
private void populateCalendarException ( Record record , ProjectCalendar calendar ) throws MPXJException { Date fromDate = record . getDate ( 0 ) ; Date toDate = record . getDate ( 1 ) ; boolean working = record . getNumericBoolean ( 2 ) ; if ( fromDate != null && toDate == null ) { toDate = fromDate ; } ProjectCalenda...
Populates a calendar exception instance .
143,953
private void addExceptionRange ( ProjectCalendarException exception , Date start , Date finish ) { if ( start != null && finish != null ) { exception . addRange ( new DateRange ( start , finish ) ) ; } }
Add a range to an exception ensure that we don t try to add null ranges .
143,954
private void populateCalendar ( Record record , ProjectCalendar calendar , boolean isBaseCalendar ) { if ( isBaseCalendar == true ) { calendar . setName ( record . getString ( 0 ) ) ; } else { calendar . setParent ( m_projectFile . getCalendarByName ( record . getString ( 0 ) ) ) ; } calendar . setWorkingDay ( Day . SU...
Populates a calendar instance .
143,955
private void populateResource ( Resource resource , Record record ) throws MPXJException { String falseText = LocaleData . getString ( m_locale , LocaleData . NO ) ; int length = record . getLength ( ) ; int [ ] model = m_resourceModel . getModel ( ) ; for ( int i = 0 ; i < length ; i ++ ) { int mpxFieldType = model [ ...
Populates a resource .
143,956
private void populateRelationList ( Task task , TaskField field , String data ) { DeferredRelationship dr = new DeferredRelationship ( ) ; dr . setTask ( task ) ; dr . setField ( field ) ; dr . setData ( data ) ; m_deferredRelationships . add ( dr ) ; }
Populates a relation list .
143,957
private void processDeferredRelationship ( DeferredRelationship dr ) throws MPXJException { String data = dr . getData ( ) ; Task task = dr . getTask ( ) ; int length = data . length ( ) ; if ( length != 0 ) { int start = 0 ; int end = 0 ; while ( end != length ) { end = data . indexOf ( m_delimiter , start ) ; if ( en...
This method processes a single deferred relationship list .
143,958
private void populateRelation ( TaskField field , Task sourceTask , String relationship ) throws MPXJException { int index = 0 ; int length = relationship . length ( ) ; while ( ( index < length ) && ( Character . isDigit ( relationship . charAt ( index ) ) == true ) ) { ++ index ; } Integer taskID ; try { taskID = Int...
Creates and populates a new task relationship .
143,959
private void populateRecurringTask ( Record record , RecurringTask task ) throws MPXJException { task . setStartDate ( record . getDateTime ( 1 ) ) ; task . setFinishDate ( record . getDateTime ( 2 ) ) ; task . setDuration ( RecurrenceUtility . getDuration ( m_projectFile . getProjectProperties ( ) , record . getIntege...
Populates a recurring task .
143,960
private void populateResourceAssignment ( Record record , ResourceAssignment assignment ) throws MPXJException { Resource resource = m_projectFile . getResourceByUniqueID ( record . getInteger ( 12 ) ) ; if ( resource == null ) { resource = m_projectFile . getResourceByID ( record . getInteger ( 0 ) ) ; } assignment . ...
Populate a resource assignment .
143,961
private void populateResourceAssignmentWorkgroupFields ( Record record , ResourceAssignmentWorkgroupFields workgroup ) throws MPXJException { workgroup . setMessageUniqueID ( record . getString ( 0 ) ) ; workgroup . setConfirmed ( NumberHelper . getInt ( record . getInteger ( 1 ) ) == 1 ) ; workgroup . setResponsePendi...
Populate a resource assignment workgroup instance .
143,962
static void populateFileCreationRecord ( Record record , ProjectProperties properties ) { properties . setMpxProgramName ( record . getString ( 0 ) ) ; properties . setMpxFileVersion ( FileVersion . getInstance ( record . getString ( 1 ) ) ) ; properties . setMpxCodePage ( record . getCodePage ( 2 ) ) ; }
Populate a file creation record .
143,963
public static RelationType getInstance ( Locale locale , String type ) { int index = - 1 ; String [ ] relationTypes = LocaleData . getStringArray ( locale , LocaleData . RELATION_TYPES ) ; for ( int loop = 0 ; loop < relationTypes . length ; loop ++ ) { if ( relationTypes [ loop ] . equalsIgnoreCase ( type ) == true ) ...
This method takes the textual version of a relation type and returns an appropriate class instance . Note that unrecognised values will cause this method to return null .
143,964
public static final Duration parseDuration ( String value ) { Duration result = null ; if ( value != null ) { int split = value . indexOf ( ' ' ) ; if ( split != - 1 ) { double durationValue = Double . parseDouble ( value . substring ( 0 , split ) ) ; TimeUnit durationUnits = parseTimeUnits ( value . substring ( split ...
Convert the Phoenix representation of a duration into a Duration instance .
143,965
public static final String printDuration ( Duration duration ) { String result = null ; if ( duration != null ) { result = duration . getDuration ( ) + " " + printTimeUnits ( duration . getUnits ( ) ) ; } return result ; }
Retrieve a duration in the form required by Phoenix .
143,966
public static final String printFinishDateTime ( Date value ) { if ( value != null ) { value = DateHelper . addDays ( value , 1 ) ; } return ( value == null ? null : DATE_FORMAT . get ( ) . format ( value ) ) ; }
Retrieve a finish date time in the form required by Phoenix .
143,967
public static final Date parseFinishDateTime ( String value ) { Date result = parseDateTime ( value ) ; if ( result != null ) { result = DateHelper . addDays ( result , - 1 ) ; } return result ; }
Convert the Phoenix representation of a finish date time into a Date instance .
143,968
private FieldType getFieldType ( byte [ ] data , int offset ) { int fieldIndex = MPPUtility . getInt ( data , offset ) ; return FieldTypeHelper . mapTextFields ( FieldTypeHelper . getInstance14 ( fieldIndex ) ) ; }
Retrieves a field type from a location in a data block .
143,969
private ProjectFile readFile ( File file ) throws MPXJException { try { String url = "jdbc:sqlite:" + file . getAbsolutePath ( ) ; Properties props = new Properties ( ) ; m_connection = org . sqlite . JDBC . createConnection ( url , props ) ; m_documentBuilder = DocumentBuilderFactory . newInstance ( ) . newDocumentBui...
By the time we reach this method we should be looking at the SQLite database file itself .
143,970
private ProjectFile read ( ) throws Exception { m_project = new ProjectFile ( ) ; m_eventManager = m_project . getEventManager ( ) ; ProjectConfig config = m_project . getProjectConfig ( ) ; config . setAutoCalendarUniqueID ( false ) ; config . setAutoTaskUniqueID ( false ) ; config . setAutoResourceUniqueID ( false ) ...
Read the project data and return a ProjectFile instance .
143,971
private void populateEntityMap ( ) throws SQLException { for ( Row row : getRows ( "select * from z_primarykey" ) ) { m_entityMap . put ( row . getString ( "Z_NAME" ) , row . getInteger ( "Z_ENT" ) ) ; } }
Create a mapping from entity names to entity ID values .
143,972
private void processCalendars ( ) throws Exception { List < Row > rows = getRows ( "select * from zcalendar where zproject=?" , m_projectID ) ; for ( Row row : rows ) { ProjectCalendar calendar = m_project . addCalendar ( ) ; calendar . setUniqueID ( row . getInteger ( "Z_PK" ) ) ; calendar . setName ( row . getString ...
Read calendar data .
143,973
private void processDays ( ProjectCalendar calendar ) throws Exception { for ( Day day : Day . values ( ) ) { calendar . setWorkingDay ( day , false ) ; } List < Row > rows = getRows ( "select * from zcalendarrule where zcalendar1=? and z_ent=?" , calendar . getUniqueID ( ) , m_entityMap . get ( "CalendarWeekDayRule" )...
Process normal calendar working and non - working days .
143,974
private void processResources ( ) throws SQLException { List < Row > rows = getRows ( "select * from zresource where zproject=? order by zorderinproject" , m_projectID ) ; for ( Row row : rows ) { Resource resource = m_project . addResource ( ) ; resource . setUniqueID ( row . getInteger ( "Z_PK" ) ) ; resource . setEm...
Read resource data .
143,975
private void processTasks ( ) throws SQLException { List < Row > rows = getRows ( "select * from zscheduleitem where zproject=? and zparentactivity_ is null and z_ent=? order by zorderinparentactivity" , m_projectID , m_entityMap . get ( "Activity" ) ) ; for ( Row row : rows ) { Task task = m_project . addTask ( ) ; po...
Read all top level tasks .
143,976
private void processChildTasks ( Task parentTask ) throws SQLException { List < Row > rows = getRows ( "select * from zscheduleitem where zparentactivity_=? and z_ent=? order by zorderinparentactivity" , parentTask . getUniqueID ( ) , m_entityMap . get ( "Activity" ) ) ; for ( Row row : rows ) { Task task = parentTask ...
Read all child tasks for a given parent .
143,977
private void populateTask ( Row row , Task task ) { task . setUniqueID ( row . getInteger ( "Z_PK" ) ) ; task . setName ( row . getString ( "ZTITLE" ) ) ; task . setPriority ( Priority . getInstance ( row . getInt ( "ZPRIORITY" ) ) ) ; task . setMilestone ( row . getBoolean ( "ZISMILESTONE" ) ) ; task . setActualFinish...
Read data for an individual task .
143,978
private void populateConstraints ( Row row , Task task ) { Date endDateMax = row . getTimestamp ( "ZGIVENENDDATEMAX_" ) ; Date endDateMin = row . getTimestamp ( "ZGIVENENDDATEMIN_" ) ; Date startDateMax = row . getTimestamp ( "ZGIVENSTARTDATEMAX_" ) ; Date startDateMin = row . getTimestamp ( "ZGIVENSTARTDATEMIN_" ) ; C...
Populate the constraint type and constraint date . Note that Merlin allows both start and end constraints simultaneously . As we can t have both we ll prefer the start constraint .
143,979
private void processAssignments ( ) throws SQLException { List < Row > rows = getRows ( "select * from zscheduleitem where zproject=? and z_ent=? order by zorderinactivity" , m_projectID , m_entityMap . get ( "Assignment" ) ) ; for ( Row row : rows ) { Task task = m_project . getTaskByUniqueID ( row . getInteger ( "ZAC...
Read assignment data .
143,980
private Duration assignmentDuration ( Task task , Duration work ) { Duration result = work ; if ( result != null ) { if ( result . getUnits ( ) == TimeUnit . PERCENT ) { Duration taskWork = task . getWork ( ) ; if ( taskWork != null ) { result = Duration . getInstance ( taskWork . getDuration ( ) * result . getDuration...
Extract a duration amount from the assignment converting a percentage into an actual duration .
143,981
private void processDependencies ( ) throws SQLException { List < Row > rows = getRows ( "select * from zdependency where zproject=?" , m_projectID ) ; for ( Row row : rows ) { Task nextTask = m_project . getTaskByUniqueID ( row . getInteger ( "ZNEXTACTIVITY_" ) ) ; Task prevTask = m_project . getTaskByUniqueID ( row ....
Read relation data .
143,982
private NodeList getNodeList ( String document , XPathExpression expression ) throws Exception { Document doc = m_documentBuilder . parse ( new InputSource ( new StringReader ( document ) ) ) ; return ( NodeList ) expression . evaluate ( doc , XPathConstants . NODESET ) ; }
Retrieve a node list based on an XPath expression .
143,983
public void process ( ProjectProperties properties , FilterContainer filters , FixedData fixedData , Var2Data varData ) { int filterCount = fixedData . getItemCount ( ) ; boolean [ ] criteriaType = new boolean [ 2 ] ; CriteriaReader criteriaReader = getCriteriaReader ( ) ; for ( int filterLoop = 0 ; filterLoop < filter...
Entry point for processing filter definitions .
143,984
@ SuppressWarnings ( "unchecked" ) public static TimeUnit getInstance ( String units , Locale locale ) throws MPXJException { Map < String , Integer > map = LocaleData . getMap ( locale , LocaleData . TIME_UNITS_MAP ) ; Integer result = map . get ( units . toLowerCase ( ) ) ; if ( result == null ) { throw new MPXJExcep...
This method is used to parse a string representation of a time unit and return the appropriate constant value .
143,985
public BlockHeader read ( byte [ ] buffer , int offset , int postHeaderSkipBytes ) { m_offset = offset ; System . arraycopy ( buffer , m_offset , m_header , 0 , 8 ) ; m_offset += 8 ; int nameLength = FastTrackUtility . getInt ( buffer , m_offset ) ; m_offset += 4 ; if ( nameLength < 1 || nameLength > 255 ) { throw new ...
Reads the header data from a block .
143,986
public void process ( ProjectFile file , Var2Data varData , byte [ ] fixedData ) throws IOException { Props props = getProps ( varData ) ; if ( props != null ) { String viewName = MPPUtility . removeAmpersands ( props . getUnicodeString ( VIEW_NAME ) ) ; byte [ ] listData = props . getByteArray ( VIEW_CONTENTS ) ; List...
Entry point for processing saved view state .
143,987
@ SuppressWarnings ( "unchecked" ) public final List < MapRow > getRows ( String name ) { return ( List < MapRow > ) getObject ( name ) ; }
Retrieve row from a nested table .
143,988
public static String strip ( String text ) { String result = text ; if ( text != null && ! text . isEmpty ( ) ) { try { boolean formalRTF = isFormalRTF ( text ) ; StringTextConverter stc = new StringTextConverter ( ) ; stc . convert ( new RtfStringSource ( text ) ) ; result = stripExtraLineEnd ( stc . getText ( ) , for...
This method removes all RTF formatting from a given piece of text .
143,989
private static String stripExtraLineEnd ( String text , boolean formalRTF ) { if ( formalRTF && text . endsWith ( "\n" ) ) { text = text . substring ( 0 , text . length ( ) - 1 ) ; } return text ; }
Remove the trailing line end from an RTF block .
143,990
private void processWorkWeeks ( byte [ ] data , int offset , ProjectCalendar cal ) { offset += 4 ; while ( data . length >= offset + ( ( 7 * 60 ) + 2 + 2 + 8 + 4 ) ) { ProjectCalendarWeek week = cal . addWorkWeek ( ) ; for ( Day day : Day . values ( ) ) { processWorkWeekDay ( data , offset , week , day ) ; offset += 60...
Read the work weeks .
143,991
private void processWorkWeekDay ( byte [ ] data , int offset , ProjectCalendarWeek week , Day day ) { int dayType = MPPUtility . getShort ( data , offset + 0 ) ; if ( dayType == 1 ) { week . setWorkingDay ( day , DayType . DEFAULT ) ; } else { ProjectCalendarHours hours = week . addCalendarHours ( day ) ; int rangeCoun...
Process an individual work week day .
143,992
private RecurrenceType getRecurrenceType ( int value ) { RecurrenceType result ; if ( value < 0 || value >= RECURRENCE_TYPES . length ) { result = null ; } else { result = RECURRENCE_TYPES [ value ] ; } return result ; }
Retrieve the recurrence type .
143,993
private boolean getRelative ( int value ) { boolean result ; if ( value < 0 || value >= RELATIVE_MAP . length ) { result = false ; } else { result = RELATIVE_MAP [ value ] ; } return result ; }
Determine if the exception is relative based on the recurrence type integer value .
143,994
public List < GanttDesignerRemark . Task > getTask ( ) { if ( task == null ) { task = new ArrayList < GanttDesignerRemark . Task > ( ) ; } return this . task ; }
Gets the value of the task property .
143,995
public void setLeftTableModel ( TableModel model ) { TableModel old = m_leftTable . getModel ( ) ; m_leftTable . setModel ( model ) ; firePropertyChange ( "leftTableModel" , old , model ) ; }
Set the model used by the left table .
143,996
public void setRightTableModel ( TableModel model ) { TableModel old = m_rightTable . getModel ( ) ; m_rightTable . setModel ( model ) ; firePropertyChange ( "rightTableModel" , old , model ) ; }
Set the model used by the right table .
143,997
public void process ( InputStream is ) throws Exception { readHeader ( is ) ; readVersion ( is ) ; readTableData ( readTableHeaders ( is ) , is ) ; }
Extract raw table data from the input stream .
143,998
public StreamReader getTableData ( String name ) throws IOException { InputStream stream = new ByteArrayInputStream ( m_tableData . get ( name ) ) ; if ( m_majorVersion > 5 ) { byte [ ] header = new byte [ 24 ] ; stream . read ( header ) ; SynchroLogger . log ( "TABLE HEADER" , header ) ; } return new StreamReader ( m_...
Return an input stream to read the data from the named table .
143,999
private List < SynchroTable > readTableHeaders ( InputStream is ) throws IOException { List < SynchroTable > tables = new ArrayList < SynchroTable > ( ) ; byte [ ] header = new byte [ 48 ] ; while ( true ) { is . read ( header ) ; m_offset += 48 ; SynchroTable table = readTableHeader ( header ) ; if ( table == null ) {...
Read the table headers . This allows us to break the file into chunks representing the individual tables .