Packages in the MapleCloud - Maple Programming Help

 Packages in the MapleCloud

MapleCloud Packages

The MapleCloud can now store package workbooks. You can browse, download and even install user-created packages in order to add new functionality to Maple.

To open the MapleCloud window, go to Tools -> MapleCloud or click on any of Public Documents, Math Apps, Packages, or Updates from under the MapleCloud icon in the main toolbar; you can also open your private cloud documents from this menu.

Updates: Maple Cloud Icon on the Maple Toolbar

 On the main worksheet toolbar, there is a new MapleCloud icon. When clicked, a drop-down menu is shown that can be used to log in to your account, making it possible to store or access your personal content in the MapleCloud. This menu can also be used to open the MapleCloud window, to adjust network settings or to manage groups.

To install a new package, simply click on the install button in the Actions column. Maple will automatically download and install the package to your Maple toolbox folder, no further steps required. If the package has any associated help documentation, this is also unpacked to your toolbox folder.

Authoring Packages

As a package author, the new packages group in the MapleCloud makes it easier than ever to share your work with Maple users around the world. You can read more about creating new package workbooks on the Creating a Package Workbook help page.

PackageTools is a new package with programmatic tools for authoring and editing packages.

 > with(PackageTools);
 $\left[{\mathrm{AddAttachment}}{,}{\mathrm{Create}}{,}{\mathrm{GetModules}}{,}{\mathrm{GetProperty}}{,}{\mathrm{Install}}{,}{\mathrm{IsPackageInstalled}}{,}{\mathrm{ListInstalledPackages}}{,}{\mathrm{SetProperty}}{,}{\mathrm{SupplyPassword}}{,}{\mathrm{Uninstall}}\right]$ (3.1)

Example: Programmatically Creating a New Package Workbook

To begin, the Create command creates a new empty workbook in the designated location:

 > Create("C:/tmp/NewPackage.maple"):

Having created a new workbook or when working with existing workbooks, it is possible to add attachments, such as help files, images and more using the AddAttachment command.

In order to make a workbook into a package, the workbook must contain a saved module.

 > NewPackage := module()    option package;    export out := () -> "Hello World!"; end module: NewPackage:-out();
 ${"Hello World!"}$ (3.1.1)

In order to save an existing module into a workbook, use the savelib command:

 > savelib('NewPackage', "C:/tmp/NewPackage.maple");

Modifying Properties of a Workbook

After a package workbook has been created, it can be shared on the MapleCloud. An important part of sharing the package workbook is to include metadata that describes the package. This metadata can be added during the upload using the updated upload dialog or can also be added (or modified) using the GetProperty and SetProperty commands.

To set the authors of a workbook:

 > SetProperty("C:/tmp/NewPackage.maple", "authors", "Maplesoft"):

To get the value for authors:

 > GetProperty("C:/tmp/NewPackage.maple", "authors");
 ${"Maplesoft"}$ (3.2.1)

Note: If you modify properties of a package that has already been uploaded to the MapleCloud, it is important to update the package in the MapleCloud after making local changes, otherwise those changes will not automatically be pushed to the online version.