Portfolio Performance Documentation

repository·master·Indexed 26 days ago

https://github.com/portfolio-performance/portfolio

An investment portfolio tracking and evaluation tool supporting stocks, cryptocurrencies, and other asset types. This documentation covers running the application in Eclipse via the LDSL plugin, technical implementation details for patched SWT fragments in product builds, and the Client domain model for managing securities, accounts, portfolios, watchlists, and taxonomies.

Tokens
1.9K
Snippets
0
Records
15
Agent score
88%

What's inside Portfolio Performance

  1. Ship patched SWT via a feature patch in the product build

    master

    To resolve version conflicts when shipping patched macOS SWT fragments (specifically for the TextKit-1 in-place-editor freeze fix), Portfolio Performance uses an Eclipse feature patch (org.eclipse.swt.patch) instead of modifying the upstream RCP feature directly.

    This approach allows the product to redirect the exact version requirements of the org.eclipse.e4.rcp feature and the org.eclipse.swt host bundle to re-qualified bundles published by the SWT fork (org.eclipse.swt.portfolio.bundles).

    Implementation Requirements

    1. Feature Patch Configuration: The patch must be applied in the product build. The org.eclipse.e4.rcp version in features/org.eclipse.swt.patch/feature.xml must be bumped manually on each platform upgrade to maintain the coupling.
    2. SWT Fork Publishing: The SWT fork must republish the host bundle and all 9 platform fragments at the bumped qualifier. Even if only the cocoa fragment contains code changes, all fragments must be re-qualified because the host bundle exact-pins every fragment at its own version.
    3. Repository Configuration: The SWT fork update-site must be added as an available-but-unrooted p2 repository in portfolio-app/pom.xml under the <repositories> section.

    Warning: Do NOT add the SWT fork as a target-definition root. Rooting both upstream SWT and the patched SWT fork would cause a singleton conflict for the org.eclipse.swt bundle. By adding it as an unrooted repository, the target remains consistent with upstream SWT, and the feature patch handles the selection of the patched bundles during the product build.

  2. Run PortfolioPerformance in Eclipse

    master

    To run PortfolioPerformance within the Eclipse IDE, you must use the LDSL plugin to dynamically create the necessary launch configurations, as these are OS-specific.

    Follow these steps:

    1. Install the LDSL plugin from https://mduft.github.io/lcdsl-latest/.
    2. Open the Launch Configuration view by navigating to: Window -> Show View -> Other... -> Debug -> Launch Configuration.
    3. In the view, right-click on Eclipse Application -> PortfolioPerformance to execute the application.
  3. Retrieve all de-duplicated transactions

    master

    The getAllTransactions() method returns a list of TransactionPair<?> objects. This list is 'de-duplicated', meaning it only includes:

    • PortfolioTransaction objects for buy and sell transactions.
    • Outbound transactions for cash or security transfers.
    • It excludes TRANSFER_IN type transactions from portfolios and certain types from accounts to provide a clean view of movements.
  4. Mark Client as dirty or touched

    master

    To trigger UI updates or recalculations, use the following methods:

    • markDirty(): Marks the client as dirty and fires a dirty property change event. This is intended to trigger a re-calculation of all views.
    • touch(): Marks the client as 'touched' by firing a touch property change event, but does not trigger a re-calculation of views. Use this when only non-calculating properties (like preferences) have changed.
  5. Listen for Client property changes

    master

    The Client supports the standard Java PropertyChangeListener pattern. You can register listeners to react to changes in the model (e.g., when securities, accounts, or watchlists are modified).

    • addPropertyChangeListener(PropertyChangeListener listener): Adds a listener for all supported property changes.
    • addPropertyChangeListener(String propertyName, PropertyChangeListener listener): Adds a listener for a specific property name.
    • removePropertyChangeListener(PropertyChangeListener listener): Removes a listener.
    • removePropertyChangeListener(String propertyName, PropertyChangeListener listener): Removes a listener for a specific property.
  6. Manage Portfolios in a Client

    master

    Use the following methods to manage portfolios:

    • addPortfolio(Portfolio portfolio): Adds a new portfolio.
    • removePortfolio(Portfolio portfolio): Removes a portfolio and its associated transactions and investment plans.
    • getActivePortfolios(): Returns a sorted list of portfolios that are not marked as retired.
    • getPortfolios(): Returns an unmodifiable list of all portfolios.
  7. Extend Client data with Protobuf Any

    master

    The Client supports third-party extensions using Google Protobuf Any types. This allows preserving unknown extension data during load/save operations.

    • addExtension(Any extension): Adds a protobuf Any object to the extensions list.
    • getExtensions(): Returns an unmodifiable list of extension data.
    • setExtensions(List<Any> extensions): Sets the list of extension data.
  8. Manage Taxonomies in a Client

    master

    Use the following methods to manage taxonomies:

    • addTaxonomy(Taxonomy taxonomy): Adds a new taxonomy.
    • removeTaxonomy(Taxonomy taxonomy): Removes a taxonomy.
    • swapTaxonomy(Taxonomy first, Taxonomy second): Swaps the positions of two taxonomies.
    • getTaxonomy(String id): Retrieves a taxonomy by its unique identifier.
    • getTaxonomies(): Returns an unmodifiable list of all taxonomies.