Packages

From AgileApps Support Wiki
Revision as of 19:12, 3 November 2011 by imported>Aeric

Designer > Global Resources > Packages

A package is a collection of objects, applications, and other platform resources.

1 About Packages

Packaging provides the ability to deploy fully-featured solutions with seamless distribution to platform Tenants. (Tenants who have installed such a package are deemed to be Package Subscribers. The user who does the installation is called the Package Installer.)

Publishers can bundle all elements of the AgileApps Cloud platform into custom Packages, which deliver customized business solutions to Package Subscribers.

AppFlowCatalog.gif

Tenants can create and publish packages for internal use, or for wider distribution.

How it Works
  1. Platform elements and applications are Packaged and Published.
  2. They can then be submitted for approval
  3. Approved packages become part of the Application Catalog
  4. Tenants can then install the published package.

Alternatively:

  • A publisher can give tenants a link they can use to install the package, without having to put it into the catalog first.


1.1 Package Items

Platform elements that are included in a Package are known as package items.

This page details when items are included in the package, when they are installed in the target system, and when old items that have been removed from the source system are deleted from the target system, as well.

The information provided here is the foundation for the companion article: Choosing a Deployment Strategy for Development Systems

1.1.1 Standard Dependencies

When an item is selected for packaging, dependent elements are automatically included. Items that are related, but upon which the selected item does not actually depend are excluded by default--although they can generally be selected manually, if desired.

Platform Element Dependent Elements
  • Application
  • Excludes Reports
    Reports can be individually selected. Reports on an object are not automatically included.
  • Excludes data
    Data is not included automatically. Java code can be written to create Package Data classes that add selected records during packaging, and that take the records out when the package is installed.
  • Classes (includes
    user-created classes)
  • Sites
  • Includes Teams and Roles involved
  • Includes Child Teams if the Include Child Teams option is selected for that team
  • Template
  • Template Access URL

For more information about Templates, see How to Create a Custom User Interface (CUI).

  • Includes localized labels and items


  • Web Tabs

1.1.2 Special Dependencies

When the following elements are added to a package, the listed items are added as dependencies:

Team Data Sharing Policies
Roles and Teams included as dependencies
  • If the Include Child Teams checkbox is enabled, the child teams of the selected teams in the Data Sharing Policy are added as dependencies
Objects in a Master-Detail relationship

Notepad.png

Note:
The "Master-Detail relationship" option on a Lookup field has been deprecated. This section is provided for legacy objects that have a Lookup field for which that option has been selected.
Learn more: Master-Detail relationships

  • If a Detail object is added to a Package, the Master object is added (automatically) as a dependent object
  • If a Master object is added to a Package and if that Master object includes any Rollup Summary Fields, then the Detail object is added (automatically) as a dependent object
  • When a Tenant installs a Package, the Rollup Summary Fields limit defined in Manage Tenant Capabilities is honored
  • If the limit is exceeded, the installation process will stop and cannot proceed
  • In order to complete the installation, delete existing Rollup Summary Fields to reduce the total number to within the defined limit
  • After packaging, do not add or remove any Master-Detail relationships; doing so may cause unexpected results and/or loss of data
Template Access URL
Templates and Application included as dependencies. For more information about Templates, see How to Create a Custom User Interface (CUI).

1.1.3 Items that are Never Packaged

These platform elements are never added to a package. Customizations made by the subscriber remain intact.

1.1.4 How Package Items are Applied

The principles that follow summarize the behavior of package items at installation time. Detailed tables list the behavior for individual items, following the summary.

1.1.4.1 Principles
  • New items in the Package are added to the subscriber's system, while items with the same ID are replaced, or updated.
Note:
All aspects of an object (fields and forms, validations, and so on) are given a Globally Unique ID or GUID. Those IDs are preserved when the package is installed, which allows existing items to be replaced while new items are added. (When the overwrite option is chosen, items on the target system that do not have a matching GUID in the package are deleted.)
  • If the subscriber created a new platform element with the same name as an item included in the package, the subscriber gets an error. (The error occurs immediately after they select the package. Installation is not allowed to proceed.)
  • With few exceptions, modified items in the Package replace the versions that came from a previous Package.
    The exceptions are:
  • Global Picklists -- Subscribers are expected to have added items and modified labels, so they are left intact.
  • Email Templates and Quick Text -- These items are overwritten only if Overwrite Previous Package was selected by the publisher.
  • Roles -- During installation, the subscriber has the option of merging or overwriting roles that are included in the package.

Notepad.png

Note: Items that were added to the target system are never deleted. Items are deleted only when: (1) They were previously installed from the source system, (2) They were subsequently removed from that system, and (3) The Overwrite Previous Package option was chosen when the package was created.

1.1.4.2 Object Aspects

This table describes the behavior of individual Object Aspects.

Object Aspect Installed when...
Added if New Updated Deleted if Old
Business Rules Package Overwrite option
Custom Form Actions Package Overwrite option
Document Templates Package Overwrite option
Email Templates Package Overwrite option Package Overwrite option
External Data Source definitions Package Overwrite option
Fields Package Overwrite option
Field Audit Log Settings n/a
Field Scripts Package Overwrite option
Forms Package Overwrite option
Form Scripts Package Overwrite option
Indexes Y
Layout Rules Package Overwrite option
Macros Package Overwrite option
Processes Package Overwrite option
Quick Text * Package Overwrite option Package Overwrite option
Record Locators n/a
Subforms Package Overwrite option
Validations Package Overwrite option
View definitions ** Package Overwrite option
Web Forms ✔ *** Package Overwrite option
* Applies only to Cases object in the ServiceDesk application.
** View definitions are included only when they are visible to all, or to an included Role. Private views are not included.
*** Web Forms on objects other than Cases can contain two kinds of email templates--an auto-response template that
is sent to the submitter, and a notification template that tells internal users about new records. Unlike other email templates, they are always overwritten.
1.1.4.3 Application Elements

This table describes the behavior of other platform elements that go into an application.

Application Element Included when Installed when
Selected or if Referenced by Added if New Updated Deleted if Old
Application Package Dependency
Template Access URL
Package Overwrite option
Classes Business Rule
Macro
Package Overwrite option
Customer Satisfaction Surveys ServiceDesk N n/a
Case Analytics Dashboard ServiceDesk n/a Package Overwrite option
Dashboards if visible to all, a Role, or a Team Package Overwrite option
Global Picklists Object Field N
Global Template Variables not included
Knowledge Base articles not included
Knowledge Base categories not included
Mapping Profiles Package Overwrite option
Object definitions Lookup field
Rollup Summary Field
Package Overwrite option
Object records Package Data class as defined by the class
Pages Custom Form Action
Dashboard
Site
Web Tab
Package Overwrite option
Reports visible to all or to an application role Package Overwrite option
Roles Application
Process
Team Data Sharing Policy
Subscriber choice N
Sites Application Package Overwrite option
SLAs not included
Static Resources Package Overwrite option
Tab Preferences Role Package Overwrite option
Team definitions Business Rule
Macro
Process
Team Data Sharing Policy
N N
Team-object Business Rules Team Package Overwrite option
Team Data Sharing Policies Package Overwrite option
Templates Template Access URL Package Overwrite option
Template Access URL Package Overwrite option
Translation Workbench entries Package Overwrite option
Users Object * n/a
User-object Business Rules Users Object Package Overwrite option
User-object Fields Users Object Package Overwrite option
View Preferences Role Package Overwrite option
Web Services Business Rule
External Data Source
External Lookup
Process
N
Web Tabs Application Package Overwrite option

Notepad.png

Note:

  1. Include the Users Object in the package whenever fields or business rules in the package has references to the Users object.
  2. Include the Users Object in the package whenever record visibility criteria for an object in the package has references to user custom field.
1.1.4.4 System Elements

This section describes important system-object and system-configuration items:

System Element Included when Installed when
Selected or if Referenced by Added if New Updated Deleted if Old
Access Profiles not included
Business Hours Calendars Process N N
Email Channel settings not included
LDAP Configuration not included
Marketplace listings * not included
Service Portal settings not included
Scheduled Jobs ** not included
Single Sign-On settings not included
* Potentially valuable for an on-premise installation that wants to back up their primary admin tenancy.
** Scheduled Rules, on the other hand, are included, along with other Business Rules.

1.2 Package Considerations

  • To publish an application, include it as part of a Package, and then publish the package. Application components are automatically added to the package.
  • The components contained in a locked package cannot be modified. So new fields cannot be added to an object, for example, and existing fields cannot be modified.
  • The components of an unlocked can be modified, with both additions and changes. Additions are preserved during an upgrade. Changes are overwritten. For example:
  • If a Rule is added to a packaged object after installation, that Rule is preserved.
  • If the packaged object contains a Rule, and that Rule is modified after installation, the modifications are overwritten by the next upgrade (assuming that the new version still contains that Rule).
  • Similarly for additions and modifications to Forms, Validations, and other aspects of the packaged object.
Notes:
  • If a field expected by such an addition no longer exists, an error will occur when the field is referenced.
  • If the field is "retired" rather than deleted (by changing it's label and using the old label on a different field), then an added item like a Rule that uses the field would still work, but could deliver inaccurate results.
  • Given those considerations, anyone who is in a role which allows them to modify an unlocked package needs to know what the package contains and know that, while additions will be preserved, any changes will be overwritten at the next upgrade.
  • When you add an item like a field to an object which is part of an installed package (and which might later be upgraded), a unique identifying number is appended--so there is no chance that a future upgrade will overwrite your addition.
Exception: If you are in a development Sandbox, working on a package imported from another Sandbox, your additions are seamless. No identifiers are appended.
  • The names of Fields and Objects created cannot match the name of any Package element. If there is a conflict, Package installation will fail. To succeed, either the Publisher or Subscriber will need to rename the conflicting item(s).
  • To include Package Data, you must Create a Data Handler class and then Configure Package Data, so that data can be selected as part of the packaging process.
  • Permissions Considerations:
    • When roles are included in a package:
      • Any permissions they contain for objects present in the package are carried over to the subscriber's instance of the platform.
      • Any administrative permissions they define are also carried over.
      • No other permissions are carried over.
    • When a user installs a package that contains role definitions:
      • The user is prompted to assign users to the new roles.
      • If the user is re-installing, the user can choose to override, ignore, or merge permissions for the new roles. (Installation documentation should instruct the user on the preferred course of action.) The choices are:
      • Override - Overwrite the existing role definition.
      • Ignore - Leave the existing role untouched.
      • Merge (the default) - form a union of existing role permissions and the role permissions defined in the package.
    • If a package does not include any Roles:
      • The package installer is shown a list of existing Roles defined in the tenancy.
      • The installer can select the Roles which will have access to the objects included in the package.
      • All selected roles get Create, Delete, and View permissions for records owned by the user, and View permissions for records owned by other team members.
  • When installing a Package that includes Sites, these fields are automatically populated:
  • Login As User for Unauthenticated Access field is populated as the user who is logged in
  • User Web Adress is BLANK

Notepad.png

Note: When a package is reinstalled, these fields retain the values configured by the Package Subscriber.

1.3 Package Limitations

These package items have the following limitations:

Report
Only reports in folders that are "Visible to Everyone" or "Visible to {someRole}" can be added to a package. Reports in folders that that are visible to specific users or teams cannot be added. (The Role needs to be added to the package, as well, unless it is sure to be on the installer's system, for example by virtue of being in a package that this one depends on.)
Learn more: About Report Folders.
Custom Object Views
Only views with the "Visible to Everyone" control, visible to selected roles, or visible to selected teams can be added to a package.
Users
Not included in packages, and must be re-created in the new instance.

Notepad.png

Note: Up to 5 translated languages can be included while packaging. Exceeding 5 is known to cause performance concerns with package installation.

2 Working with Packages

Lock-tiny.gif

Users that have the Manage Packages permission can create, modify or delete Packages 

2.1 Package Attributes

When you open a package, some sections always appear. Others only appear when the package is published:

Package Information
Basic information about the package, including:
  • Package ID - This ID is the package record ID. It's used when downloading a package, and in APIs that manipulate package contents.
Subscription Details
This section appears only when the package has been published. It contains:
  • Installation Link - The link subscribers can use to install the package.

Warn.png

Important: The value that appears in the URL's id query parameter is the package installation ID. That value is used in APIs that deploy and install packages.

Related Information
  • Items - The list of package items. (The contents of the package).
  • Package Dependencies - Other packages that are required for this package to run.

2.2 Create a Package

  1. Go to Designer > Global Resources > Packages
  2. Click [New Package] and enter the following information:
    Name
    Name of the Package (this name appears in the Catalog)
    Description
    Description of the Package
    Locked
    To Lock the package, click the checkbox Checkboxicon.gif icon
    Learn more About Locked and Unlocked Packages
  3. Click [Save]

2.3 Add Items to a Package

1. In the Related Information section, click [Add Item] to select items for the package
2. Choose the Item Type from the list of things you can include


If Package Data has been configured, the Data Handlers for configured objects will also appear in this list. (More on that subject in a moment.)

Learn more: Package Items
3. Click the checkbox Checkboxicon.gif icon for each item you want to include in the package
4. Click [Add to Package]

Continue adding until the package contains the desired items.

Notepad.png

Note: For any object that has a Workflow, any designated "Specific User" decision makers will be removed from the package, since those users will not exist in the Package Installer's system. Ideally then, ensure that no state in the Workflow has only "Specific User" decision makers. (Use roles instead.) If any states do designate specific users, warn installers that they will need to specify an owner for that state.

2.3.1 Adding Package Data Items

To add Package Data:

  1. Choose Add Item > Item Type, and choose the item that corresponds to the data in that object.
    For example, Zip Map Data.
    A pane appears that lets you specify the data elements to include.
  2. When the data-item selection appears, select All at the top left of the pane to add everything, or else select and deselect individual data items.
  3. Click [Add to Package]

Notepad.png

Note: It is possible for there to be package data that is not part of an object. When object-data is included, it is also possible that the target-object is expected to exist on the Package Installer's system. What happens is up to the Data Handler, so object definitions are not automatically included along with object data.

2.3.2 Reviewing Item Dependencies

In the Item Dependencies section, review the list of specified Package Items, along with the dependent items they caused to be included.

For example, if a report is added to a package, the Objects that are used as the basis for that report and the Database View the combines them will be added to the package as dependent items.

2.4 Specify Package Dependencies

A package can be dependent on specific versions of other packages.

Click the [Add Package Dependencies] button to add a dependency, and select the package version:

  • If the specified package is published in the current tenancy, the list of versions for that package is displayed.
  • If the specified package was installed, the currently installed version is displayed.

Considerations:

  • If package B is listed as a dependency for package A, then package B cannot be deleted as long as package A is installed.
  • Objects are only added to a package if they are not already present in a package that is listed as a dependency.

2.5 Remove an Item from a Package

  1. In the Related Information section of a Package, navigate to the item of interest
  2. Click the Remove link to delete an item
    When an item is deleted, it is automatically removed from the package along with its dependencies, for example:
    • If the report is deleted, the report and the dependencies are removed from the package as well

2.6 Publish a Package

Publish

2.7 Download a Package

A package you create can also be downloaded from the platform to your system as a zip file. Others can then use the file to install the package.

Template:TenantFeatureByName

To download a package:

  1. Publish the package, if it has not already been published.
    The Installation Details section appears.
  2. In the Installation Details section, click [Download Package].
  3. Save the file to your system from the browser.

Warn.png

Warning: Do not rename the zip file, once it has been created. During installation, the name of the file is validated against the file's contents.

2.8 Deploy a Package

Deploying a package automatically upgrades local Package Subscribers (tenants in the same platform instance who have installed the package).

Lock-tiny.gif

When you deploy a package, you can chose to automatically upgrade:

  • All (local) tenants who have installed the package
  • Selected (local) tenants who have installed the package

To deploy a Package:

  1. Create a Package, and add items to it.
  2. Click [Publish]
    The zip file and Installation Link are created.
  3. Click [Deploy].
  4. Specify which tenants to upgrade.
  5. Specify a deployment time, or chose Immediate.
  6. Click [Deploy] again to act on your selections.
Learn more: Package Approval or Rejection

2.9 Distribute a Package to Remote Tenants

When a Package is Published, it can be downloaded from a browser. An Installation Link is automatically created that can be used to distribute the package.

To Give the Download URL to Remote Tenants:

  1. Click Designer > Global Resources > Packages
  2. Click the link of the package of interest
  3. In the Installation Details section, find the Installation Link
  4. Copy the Installation Link URL and paste it into a web page or send it in an email.

Users with valid accounts can then download the package and install the application by following this procedure, which should be provided in the installation instructions:

  1. Paste the Installation Link URL into a web browser to visit the installation page.
  2. Click the [Install] button to install the package.
    (A valid user account is required to Login.)

2.10 Delete a Package

When a Package is deleted, the Teams and Roles are not deleted

  • To remove the Teams or Roles from an installed Package, delete the Teams or Roles manually

To delete a package:

  1. Click Designer > Global Resources > Packages
  2. Click the package name to open the package of interest
  3. Click the [Delete] button to delete the package

If a Package is deleted and that package has been installed, or if the package is being used by any other package, then any items or dependent items in the package are retained, and are not deleted.

3 Installing Packages

3.1 About Package Installation

During installation, these actions are taken by the platform:

  • If the Package Subscriber has created an item with the same name as an item in the package, the installation will fail. In order for package installation to succeed, the Package Subscriber must change the name of the Field or Object that is in conflict.
  • Role and Team names are not validated for uniqueness
  • If the Role/Team names match the Default Roles or My Team (default), then duplicate roles/teams are created; To avoid confusion, it is recommended that the roles/teams be renamed
  • If a child team is included in the package, it will be attached to the first top-level team in the installer's instance

3.2 About Locked and Unlocked Packages

In an Unlocked package, objects and data can be modified and deleted by the Package Subscriber.

In a Locked package, in contrast:

  • Data can be modified and deleted, but objects (including global picklists) can only be modified to the extent that permission to do so has been granted by their respective Object Packaging Options.
  • Any classes, components, data policies, pages, and any other form of executable java code contained in the package cannot be viewed, edited, or deleted by the Package Subscriber.
Exception
  • A subscriber to a locked package can still modify Custom Access Criteria. Those settings are retained during an upgrade.
Considerations
  • The Publisher can change an Unlocked package to a Locked package
  • A Locked package cannot be changed to an Unlocked package
  • The Object Packaging Options apply only to Locked packages
Notes
  • Roles control the user's ability to customize the platform
  • Consider modifying roles to support best practices

3.3 Information for Package Installers

Considerations
  • When installing a package upgrade, new items are added and existing items are either Merged or Overwritten, based on the Overwrite Previous Package configuration defined by the Publisher
  • Package Subscribers can repackage or republish items based on the Package System-Generated Objects configuration
Available actions for Locked Packages
Users cannot Edit or Delete package items, however:
  • After installation, Package Subscribers can choose to Enable or Disable the following items, if the publisher has granted that permission in the Object Packaging Options:
Available actions for Unlocked Packages

Users can Edit or Delete package items

Considerations
  • When an unlocked package is upgraded by the Publisher, local customizations made by the Package Subscriber may be overwritten.
  • To signal that fact, a warning message is displayed before the upgrade: Customizations are over-written with a package upgrade

3.4 Installing from a File

A package can be downloaded to your system as a zip file and used for installation. This feature is used to migrate packages between separate instances of the platform--for example, in a development environment.

Template:TenantFeatureByName

To install a package from a file:

  1. Download the zip file that contains the package.
  2. Visit Designer > Global Resources > Packages
  3. Click [Install from File]
  4. Use the File Chooser to select the zip file
  5. Click [Next].
    The package is installed.

Warn.png

Warning: Do not rename the zip file after downloading it. During installation, the name of the file is validated against the file's contents.

3.5 Special Considerations for ISVs

  1. ISV Admin can subscribe to own packages. (If the Admin user has published a package on another system, then it can be uploaded to any other Admin database on other systems.)
  2. ISV Admin can republish installed items which came from the same publisher. (If the Admin user has installed a package, items from this package may be republished in other packages.)
  3. ISV Admin can republish whole packages that have been installed from another Admin database. (The Admin user can edit the package, add or remove items, and publish the package again.)
  4. Admin can manage items inside a locked package if it came from another admin database.

3.6 What Happens to Modified Objects when a Package is Re-Installed?

The short answer is, "the platform does the right thing". So data is never lost without warning. The longer answer depends on the case at hand:

Publisher has added a field
The new field is added during package installation. The field value is empty in all existing records. Additional programming or manual updates are required to populate those fields with values.
Publisher has removed a field
In general, the field is not removed during package installation. It remains in the Subscriber's object. Record data stored in that field is unaffected.
Exception: If the package was locked and the publisher has chosen to overwrite the previous version when re-publishing, then the field is removed during package installation.
Subscriber has added a field
The field remains in the object, and stored data is unaffected.
Subscriber has removed a field
The field is added back when the package is reinstalled.

Notepad.png

Note: The one situation that does not arise is that of a renamed field. Fields can be added and removed, but they cannot be renamed. (The field label can change, but not its name.) In effect, the field name is a unique index, so the platform always knows what to do.