[deepamehta-devel] Upgrading your plugin to deepamehta 4.5

mre at deepamehta.de mre at deepamehta.de
Sun Mar 15 00:03:19 CET 2015



Hi dear dm-developers,

These were my four todos for upgrading a plugin to the collaborative 4.5.
This tips are based on the new dm4-wikidata-toolkit [1] plugin.

1 if your plugin introduces a workspace: you have to inject the
WorkspacesService into your migration
2 if your plugin introduces a workspace: you have to use the
WorkspacesSercices and correctly set an owner
3 assign all your custom types
4 adapt your client-side code

Read below for all details and may this help you save some time during
upgrading.

Cheerio!

-- 

[1] https://github.com/mukil/dm4-wikidata-toolkit

-- 

1 specify sharing mode of new workspace:

solution is: we need to use the new way of workspace creation, which is:

1.1 inject WorkspacesService into plugin is necessary (to inject it into
migration).
1.2 now you can inject WorkspacesService into your migration (skipping 1.1
leads to a vague compilation error)

2 check/set owner of new workspace - imported ACLservice into migration,
too! - DONE

found new service method: setWorkspaceOwner() - mandatory to use if you
want to have your topics editable by the workspaceOwner (in my case
"admin")

3 assign all your plugins types to your new workspace

3.1 load topics by type-uri (dms.getTopics()
3.2 load TopicType or AssocType via the use dms.getTopicType() or
dms.getAssocType for each of the topic
3.3 load TopicType and use dms.getTopicType() for each.

attention: if you use a wild-card for loading all your types, there might
be AssocTypes sharing that uri (which you then need to load via
dms.getAssocType() explicitly and there might be simple topics (sharing
your plugins uri), as they are pre-installed configuration topics
delivering deafault settings/options configurable for end-user.

4 adapt your client-side webclient extension:

you' might find an uncaught typeerror in your plugin.js if you made use of
"dm4c.has_create_permission", e.g. to enable certain features / commands
just for authorized users

reason: a method signature in the `dm4c` has changed, the correct call is
now "dm4c.has_create_permission_for_topic_type"



More information about the devel mailing list