|
SAP NetWeaver '04 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
Contains classes and interfaces to persist information related to resources on the database.
See:
Description
| Interface Summary | |
| IApplicationProperties | The application properties service is used to persist arbitrary data for a resource. |
| IAppProperty | An application-defined and personalized property of a resource object in any repository. |
| IAppPropertyCollection | A read-only collection of application properties Copyright (c) SAP AG 2001-2004 |
| IAppPropertyIterator | An Iterator for an application property map. |
| IAppPropertyMap | A read-only map of application properties. |
| IResourceAppPropertyMap | A read-only map of application properties. |
| Class Summary | |
| AppProperty | An application-defined property of a resource object in any repository. |
Contains classes
and interfaces to persist information related to resources on the
database.
Purpose
Detailed_Concept
Interfaces_and_Classes
Code_Samples
Implementation_Notes
The package implements a service that enables applications to persist information related to resources as application properties on the database. These properties are different to other KM properties like system, custom or predefined properties because they are not stored with resources in a repository. They are stored directly on the database and act as a container for any type of information that is related to a resource.
Application properties are always
associated with an application and must therefore use an application-defined
namespace. They are particularly useful for repository types
that do not support custom properties. For example, a file system (fs)
repository does not support custom properties. This means application
properties are the only way in which it can persist information
related to resources.
A further advantage of
application properties is that they allow the storage
of user-specific information for each resource. If a property is
user-specific, it is stored individually for each user with a
corresponding user-specific value. Other KM
property types do not allow storage of
user-specific values.
The application property service
responds to resource events. This means it registers itself for the
events that are triggered when a resource is renamed, deleted or copied.
If a resource is renamed, the service ensures that that the resource
keeps its properties. If a resource is deleted, the service ensures that
its properties are also deleted. When a resource is copied the behavior
of the service is controlled by a parameter that is specified when an
application property is created. Depending on the value of the parameter
the properties are either deleted or retained during the copying process.
The interfaces available for the application properties service enable programs to set, manipulate and access the application properties of a resource. The central interfaces are:
IApplicationProperties
This interface represents the application properties service. It offers
methods to save the application properties of a resource, to delete
properties or to access them. The methods for getting and setting
properties differ, depending on whether user-specific properties or
general properties are involved.
IAppProperty
An IAppProperty object represents an application property that is assigned
to a resource. The
interface defines methods to access the value of a property and to find
out other information about the property, for example, its type, whether
it is multi-valued or whether it is copied when the resource is copied. An IAppProperty object is a prerequisite for defining
a property. When it is instantiated it
must be assigned a name from the application namespace to ensure that it
is unique and cannot be overwritten. Also, it must be assigned a specific data type like boolean, date, integer, long
or string . The data type
dictates the methods that can be used to retrieve property values.
IAppPropertyMap and IResourceAppPropertyMap
These interfaces represent application
properties in the form of a read-only map. IAppPropertyMap lists IAppProperty
objects with their corresponding PropertyName.
IResourceAppPropertyMap lists IAppProperty
objects with their corresponding resources. For example, the method getProperty(IPropertyName propertyName,IRidList ridList,ResourceContext context)
returns a map that lists IAppProperty
objects with the specified name and corresponding
resources.
The code samples show you how to:
//Get a
resource and the application property service
s =
res.getRepositoryManager().getService
(IWcmConst.APP_PROPERTIES_SERVICE);
if
(s != null) {
ps =
(IApplicationProperties) s;
throw
new Exception("Application properties service
not
available");
}
PropertyName pName = new
PropertyName("some_namespace", "name");
// Set application property
ps.setProperty(new AppProperty(pName, "value", null,
true),
res);
// Get property by name
IAppProperty appp = ps.getProperty(pName, res);
System.out.println(appp.getStringValue());
// Set personalized property
ps.setProperty(new AppProperty(pName, "personal
value",
"some_user_id", true),
res);
// Get property by name and user ID
appp =
ps.getProperty(pName, res, "some_user_id");
System.out.println(appp.getStringValue());
|
SAP NetWeaver '04 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||