Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] orion.page.link.related contributions in Orion 5.0

Thanks, Mark.

This is what my contribution looked like:

provider.registerServiceProvider("orion.page.link.related", {}, {
    id: "orion.cloudfier.content.examples",
    tooltip: "Check out existing projects from the Cloudfier example repository.",
    name: "Get Cloudfier examples",
    uriTemplate: "{OrionHome}/git/git-repository.html#,cloneGitRepository=https://bitbucket.org/abstratt/cloudfier-examples.git"
});

I added the category as you suggested, and had to change the uriTemplate as well:

provider.registerServiceProvider("orion.page.link.related", {}, {
    category: "edit",
    id: "orion.cloudfier.content.examples",
    tooltip: "Check out existing projects from the Cloudfier example repository.",
    name: "Get Cloudfier examples",
    uriTemplate: "/git/git-repository.html#,cloneGitRepository=https://bitbucket.org/abstratt/cloudfier-examples.git"
});

1) The uriTemplate with the {OrionHome} placeholder that used to work in 4.0 was expanding to be relative to the current page (Edit), resulting in an invalid url (http:.../edit/http...). I guess I should report that? Or you are just going to clarify the new tokens in the documentation?

2) My contribution above means that now if the user clicks the Edit icon from the edit screen (not the related link bubble), they trigger my link. I guess that is a bug when number of links == 1?

Cheers,

Rafael



On Fri, Mar 14, 2014 at 11:46 AM, Mark Macdonald <mamacdon@xxxxxxxxx> wrote:
I am curious though about where contributions to the orion.page.link.related extension point should appear.

These now appear in the navigation menu attached to the left-hand margin.
 
Are the conditions for them appearing any different now?

Yes: contributed links need to have a "category" field, which determines which menu item the link appears in. Orion ships with categories "edit", "git", "search", "shell", "sites". If a link doesn't have a category, it does not appear. (In future maybe we might toss uncategorized links into a "miscellaneous" category-- I'm not sure yet.) The same rules apply to "orion.page.link" contributions.

For example here's Orion's Git Status related link:

provider.registerService("orion.page.link.related", null, {
    id: "eclipse.git.status2",
    category: "git",    // Put link in the Git menu
    order: 10,          // Position of this link within the menu. Default is 100
    uriTemplate: "{+OrionHome}/git/git-status.html#{,GitStatusLocation}"
    nameKey: "Git Status",
    tooltipKey: "Go to Git Status",
    nls: "git/nls/gitmessages",
});


Additional categories are defined by "orion.page.link.category" contributions. Categories need to have an imageClass and id at minimum.

provider.registerService("orion.page.link.category", null, {
    id: "git",
    imageClass: "core-sprite-repository", // CSS icon class
    order: 20,   // Position of this category in the navigation menu
    nameKey: "Git",
    nls: "git/nls/gitmessages",
});


Orion tries to emphasize contextually relevant links, so it doesn't render links whose HREF is the same as your current window.location. Individual links can override this with the boolean flag force.

There's also a default flag, which hides a link unless the category would otherwise be empty. This lets us show a consistent set of categories all the time in the menu, but avoids overloading the user with static links when more relevant links are available instead.

I'll spend some time today updating the API docs on the Orion wiki. Due to the huge volume of changes late in 5.0, the docs fell behind.


Mark


On Thu, Mar 13, 2014 at 6:48 PM, Rafael Chaves <rafael@xxxxxxxxxxxx> wrote:
Hi all,

Trying 5.0 for the first time, it is looking great. I am curious though about where
contributions to the orion.page.link.related extension point should appear. Should they still work? Are the conditions for them appearing any different now?

Cheers,

Rafael

_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top