Git Product home page Git Product logo

socialplanning / opencore Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 1.0 11.45 MB

Software that drives CoActivate.org

Home Page: http://coactivate.org/

License: GNU General Public License v3.0

Python 38.67% Makefile 0.01% JavaScript 57.83% COBOL 0.09% XSLT 0.56% HTML 1.12% CSS 1.52% Shell 0.07% Roff 0.12%
python python2x plone3x plone4x wordpress blog wiki socialplanning opencore coactivate

opencore's People

Contributors

alecpm avatar anil avatar dmayle avatar ejucovy avatar ianb avatar jab avatar ltucker avatar macagua avatar mchua avatar nickgrossman avatar novalis avatar rafrombrc avatar rmarianski avatar sbenthall avatar scrollie avatar slinkp avatar tcoulter avatar whitmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

conectivo

opencore's Issues

Preserve creation dates and creators through export/import?

I don't know offhand if it's possible to preserve original creation dates and creators when reimporting content from an export. If we can't, it's not a blocker, but it would be a shame to lose that data, so it's worth investigating.

This pertains to all major content types -- members, projects, mailing lists, wiki pages -- I assume the answer (and technique, if there is one) will be the same for all content types.

Wiki Attachment export: retain creator, creation date, and title

Wiki attachments are currently losing some information in export:

  • Creator
  • Creation Date
  • Title (as distinct from filename/ID)

These need to be somehow added to the export, and then also factored into the reimport code.

A simple way to do this would be adding a microformatted index.html page to each page subdirectory that has attachments, e.g.:

<ul>
  <li><a href="attachment-1.pdf">Title For First Attachment</a> uploaded on <time pubdate datetime="2005-11-13T09:00Z"></time> by <span class="author">ejucovy</span></li>
  ...
</ul>

We could then just parse that on reimport.

Content encoding issues with listen export/import

In some test runs of Listen export->reimport, I noticed what look like some content encoding issues -- blobby-question-mark entities appearing in the reimported archives where they were not present in the original.

Need to reproduce this bug and fix it.

Project team reimport

  • Team
  • Site members requesting to be members
  • Site members invited
  • Email invites
  • Membership requests pending confirmation of new site account

Make sure to preserve dates for all, and listed + role status for full fledged team members.

User export

Remaining to do:

  • site role (admin/member)
  • confirmation code for unconfirmed members? maybe?
  • last login date

Incremental project reexport

Ideally, we'd scan each project and determine if it has been modified at all since its last export. This looks like it will be very difficult though. Many objects don't cause the project' lastModifiedDate to change when the objects change (e.g. new mailing list messages, changes to team membership) and some objects evidently don't even update their OWN lastModifiedDate to reflect all changes (e.g. promoting a team member to admin)

I think a good enough solution would be to just check whether the project's wiki needs to be re-exported. This should be pretty easy, and also will give us the most speedup -- wiki export is the slowest part of project export by far. So the entire project would be exported into a new zipfile, but we would check if an existing wiki export is up-to-date and, if so, just move that wiki export into our new zipfile instead of re-exporting the wiki.

Reimport user wikis

  • Export wiki history
  • Export metadata for each page (maybe handled in history)
  • Export file attachments
  • Import history
  • Preserve metadata on import
  • Import file attachments

Create Listen lists from exported data

In a project export, there will be a lists/ directory. Within the lists/ directory, there will be a subdirectory for each mailing list in the project.

Each exported mailing list contains a settings.ini file generated from this template: https://github.com/socialplanning/opencore/blob/master/opencore/export/export_list_conf.ini.tmpl -- which should contain all data necessary to reconstruct a mailing list, including its mailto, list of managers, and workflow policies.

So, the import code will need to iterate through the subdirectories of lists/ and create a new mailing list object for each subdirectory, based on that subdirectory's settings.ini data.

Wiki import

We need to support reimport of wikis from a project export.

The structure of the project export means that data will be in two places.

The primary data will all live in the wiki_history/ subdirectory of the export. This is a BZR repository with full wiki history, preserving original commit dates, messages and authors. File contents are preserved in their "unbaked" wiki formats.

Meanwhile, file attachments will live in subdirectories of the pages/ subdirectory of the export. Historical revisions of file attachments are not preserved (by design). Current versions of attachments are organized by the pages that they are attached to. So attachments on the "project-home" page live in the pages/project-home/ subdirectory of the export.

Import can therefore be done in two phases:

  1. Complete content import from BZR history from first revision to last
  2. File attachment import from pages subdirectory, in any order

The pages/ subdirectory also contains current wiki page contents, transformed into "baked" HTML with headers and necessary CSS links, so that the export's pages/ subdirectory is suitable for standalone drop-in publication to a web server. These should be discarded during import: they are lossy, and redundant with the lossless BZR history.

Serialize project team info onto a wiki page?

Allow admins to specify a wiki page that should receive a serialization of the project's team, automatically updated every time the team changes.

Need to think more about security here.

Export/import of Listen attachments

Need to investigate whether the existing Listen export functions handle message attachments. If not, we need to build that in to both export and import; in some cases it's essential content.

Script to export all projects

We'll need a script that exports all projects.

Here's some code that looks like it works, given constants PROJ_ID and OUTDIR:

>>> from opencore.utils import setup
>>> app=setup(app)
>>> from opencore.export.export_utils import *
>>> project = app.openplans.projects[PROJ_ID]
>>> status = get_status(project.id)
>>> status.features = ["wikipages", "mailinglists", "wikihistory"]
>>> outdir = OUTDIR
>>> tmpfd, tmpname = tempfile.mkstemp(suffix='.zip', prefix=TEMP_PREFIX, dir=outdir)
>>> tmp = os.fdopen(tmpfd, 'w')
>>> z = ZipFile(tmp, 'w')
>>> proj_dirname = badchars.sub('_', project.id)
>>> exporter = ContentExporter(project, None, status, proj_dirname, z)
>>> exporter.save()
>>> z.close()
>>> tmp.close()

Project metadata export

We currently support export of projects' contents, but do not export the metadata about the project itself.

This needs to include:

  • Project ID/slug
  • Project title
  • Project description
  • Project creation date
  • Project security policy
  • Installed featurelets
  • Project homepage
  • Project team -- including member roles and privacy ("listed") settings, as well as member join dates
  • Project creator
  • Project logo
  • Project modification date
  • Project location

Migration to convert pending membership requests for active members

Find them by code like:

for mem in app.openplans.portal_memberdata.keys():
  if not IHandleMemberWorkflow(app.openplans.portal_memberdata[mem]).is_unconfirmed():
    if IAnnotations(app.openplans.portal_memberdata[mem]).get("opencore.member.pending_requests", {}).items():
      print mem, IAnnotations(app.openplans.portal_memberdata[mem]).get("opencore.member.pending_requests", {}).items() 

Reimport site "News"

  • Export news history
  • Export metadata for each page (maybe handled in history)
  • Export file attachments
  • Import history
  • Preserve metadata on import
  • Import file attachments

Not sure what content there is other than "News" -- I'm pretty sure About/Contact/etc are all views instead of content, but we need to make sure we don't miss any.

Test and support Listen archives+subscribers import

Listen already has import features built in, but they aren't tested at all in an opencore setting.

The built-in export and import features pertain to:

  • Mailing list archives (in MBOX format)
  • Mailing list subscribers and allowed senders (in CSV format)

The built in export/import features do not include metadata and settings on the list itself (including list managers) -- these need to be handled separately.

Project reimport: featurelets and homepage

Right now I'm just hardcoding all projects to have listen, and nothing else, on reimport.

And I'm currently setting the homepage for all projects to /summary.

Need to pull these preferences from the settings.ini instead.

Preserve wikipage titles on export and import

They're already there on export, but not in a very machine-friendly format -- they just exist in an <h1> on the baked export.

Should add it to the JSON map file as well. (I think I have a JSON somewhere?)

Site manager view: "unconfirmed members"

Add site manager views to list all unconfirmed members.

For each unconfirmed member, show:

  • User ID
  • Email address
  • Creation date
  • Pending membership requests, with messages

For each unconfirmed member, allow manager to:

  • Delete member (with all pending membership requests)
  • Delete one or more pending membership requests
  • Resend confirmation code email
  • Generate confirmation link for direct sending
  • Auto-confirm member (making sure to properly convert all pending membership requests, create people folder content)

Wiki pages on /summary are unordered on reimport

On the summary page, wiki pages end up being randomly ordered after reimport. The last modified dates are all correct on the pages themselves, but the summary page (and presumably the underlying RSS feed) isn't sorting by that somehow. Maybe we just need to reindex some catalog after import.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.