Folders (resource collections) are used to store objects
(files or resources) in organized groupings. Folders can contain
resources and other folders, also known as subfolders. Resources
can only be stored in one folder at a time.
Files inherit access control lists (ACLs) from folders, and subfolders
inherit ACLs from their parent folders. Therefore, the parent folders
must exist before you can create child folders. The IDE lets you
interact only on a folder-by-folder basis, not on a file-by-file
basis. You cannot version folders and there is no need to do so;
a folder does not contain data itself. Rather, it is only a container
for resources that contain data. The default ACL is system-level
permission, which means that users must have system-level permissions
(read, write, traverse, managing ACLs) until someone gives them
permissions for a particular folder. ACLs only work in the IDE.
Summary of steps
To create a folder, follow these steps:
-
Include project files.
-
Create the service client.
-
Create the folder.
-
Write the folder to the repository.
Include project files
Include the necessary files in your development
project. If you are creating a client application using Java, include
the necessary JAR files. If you are using web services, include
the proxy files.
Create the service client
Before you can programmatically create
a resource collection, you must establish a connection and provide
credentials. This is accomplished by creating a service client.
Create the folder
Invoke the Repository service method to create
the resource collection and populate the resource collection with
identifying information, including its UUID, folder name, and description.
Write the folder to the repository
Invoke the Repository service
method to write the resource collection, specifying the target folder’s
URI.
Create folders using the Java API
Create
a folder by using the Repository service API (Java):
-
Include project files
Include project files in
your Java project’s class path.
-
Create the service client
Create a
ResourceRepositoryClient
object
by using its constructor and passing a
ServiceClientFactory
object
that contains connection properties.
-
Create the folder
To create a resource collection,
you must first create a
com.adobe.repository.infomodel.bean.RepositoryInfomodelFactoryBean
object.
Invoke
the
repositoryInfomodelFactoryBean
object’s
newResourceCollection
method,
and pass in the following parameters:
-
A
com.adobe.repository.infomodel.Id
UUID
identifier to be assigned to the resource.
-
A
com.adobe.repository.infomodel.Lid
UUID
identifier to be assigned to the resource.
-
A
java.lang.String
containing the name of
the resource collection. For example,
FormsFolder
.
The
method returns a
com.adobe.repository.infomodel.bean.ResourceCollection
object
representing the new folder.
Set the folder’s description
by using the
setDescription
method and pass in
the following parameter:
-
Write the folder to the repository
Invoke the
ResourceRepositoryClient
object’s
writeResource
method
and pass in the URI of the folder and the
ResourceCollection
object.
For example, the URI to the folder can be the following value
/Applications/FormsApplication/1.0/
.
The
method returns an instance of the newly created
com.adobe.repository.infomodel.bean.Resource
object.
You can, for example, retrieve the identifier value of the new resource
by invoking the
com.adobe.repository.infomodel.bean.Resource
object’s
getId
method.
Create folders using the web service API
Create a folder by using the Repository service
API (web service):
-
Include project files
-
Create the service client
Using the Microsoft .NET
client assembly, create a
RepositoryServiceService
object
by invoking its default constructor. Set its
Credentials
property
using a
System.Net.NetworkCredential
object that
contains the user name and password.
-
Create the folder
Create the folder by using the default
constructor for the
ResourceCollection
class and
pass in the following parameters:
-
An
Id
object,
which is created by invoking the default constructor for the
Id
class
and assigned to the
Resource
object’s
id
field.
-
An
Lid
object, which is created by invoking
the default constructor for the
Lid
class and assigned
to the
Resource
object’s
lid
field.
-
A string containing the name of the resource collection,
which is assigned to the
Resource
object’s
name
field.
The name used in this example is
"testfolder"
.
-
A string containing the description of the resource collection,
which is assigned to the
Resource
object’s
description
field.
The description used in this example is
"test folder"
.
-
Write the folder to the repository
Invoke the
RepositoryServiceService
object’s
writeResource
method
and pass in the following parameters:
-
The path where
the folder is to be created.
-
The
ResourceCollection
object representing
the folder.
-
Pass
null
for the other two parameters.
|
|
|