When publishing a file to CleverPath Portal there are a number of properties that may be configured which determine how that file will be handled. This document supplements the current CleverPath Forest and Trees 7.0 Help Topics, specifying definitions for a number of properties, including example code demonstrating the process of programmatically publishing a Microsoft Excel file to CleverPath Portal.
For any given object, the Object Wizard may be used to list properties and methods for that object. For publishing to the Portal, the particular object type of interest is 'PortalPublisher'.
To use the Object Wizard, a variable of the appropriate object type must be declared, either with a Dim statement or in the Tools > Variables dialog. Within the Edit Formula window, position the cursor after the Dim statement (if declared locally), select the Object Wizard button (the first one in the Edit Formula window toolbar), then select the desired object type and the variable representing an instance of that object type. On the next wizard page will be listed the methods and properties supported by that object, and a short description of the methods and their parameters (if any).
To demonstrate the usage of Portal Publisher properties an example FTV may be downloaded. The example provides code that will login to the Portal, set Portal permissions on a Microsoft Excel file, and publish the Microsoft Excel file to the CleverPath Portal.
The example portal_pub.ftv requires some configuration to function within a given environment. See the formula script for view 'publish'. The individual line of script requiring configuration are marked 'Change'.
Modify the view 'publish' formula script to configure the following Portal parameters
Change 1 - <portal Username>
Change 2 - <portal Server>
Change 3 - <port>
Change 4 - <password>
This will allow the application to login to the Portal
Modify the view 'publish' formula script to configure the following Publisher parameters
Change 5 - Determine the object key for the parent folder in portal where you want to publish the file. Each folder in portal has an object key that can be found by logging in to the portal.
Eg) pp.Parent := 103
Change 6 - Specify the local path for the source file to be published (note the trailing slash)
Eg) sourceFilePath := 'C:\Documents and Settings\username\My Documents\My Excel\'
Change 7 - Specify the filename for source file to be published
Eg) sourceFileName := 'a.xls'
Change 8 - Specify the Title for the published content.
pp.Title := 'test excel' // optional--could duplicate file name
Change 9 - The (MIME) ContentType must be set to the appropriate value for the type of file being published. A table of the standard content types defined on CleverPath Portal is included at the end of this document. In the example this parameter is set for Excel.
Eg) pp.ContentType := 'application/vnd.ms-excel'
Change 10 - Change the GroupOwner to the object key of the Portal Workgroup that the content will belong. This can be found by logging into the Portal.
Eg) pp.GroupOwner := 72
Change 11 - Set the View/Modify Permissions for the published file. A table containing the available View/Modify permissions on CleverPath Portal is included at the end of this document.
Eg) pp.Permissions := 'GroupModify' // (or numeric equivalent: 504)
Change 12 - Set the Userowner for the published file to the object key of the Portal User. The object id for a Portal User can be found by logging into the Portal, or in the example ftv, this is retrieved automatically in View 'ps' through a portal statistics view.
Eg) pp.UserOwner := 22 // object key obtained from portal
When the example ftv has been configured correctly, calculating the view 'publish' should result in the specified file being published to the Portal with the given permissions.
The example provided is intended to illustrate how permissions and other properties may be set when publishing content. It is likely that any programmatic publishing implementation will require additional design and coding dependent on the specific requirement and environment.
Sample code in this document is:
Copyright ? 2004 Computer Associates International, Inc. All rights reserved.
You have a royalty-free right to use, modify, reproduce, and distribute this sample code in any way you find useful, if you agree that Computer Associates has no warranty, obligations, or liability for any sample code.
File Extension | Set ContentType to this value |
aif | audio/x-aiff |
aifc | audio/x-aiff |
aiff | audio/x-aiff |
art | x-jg |
asf | video/x-ms-asf |
asx | video/x-ms-asf |
au | audio/basic |
avi | video/x-msvideo |
bmp | image/bmp |
c++ | text/plain |
c | text/plain |
cc | text/plain |
class | application/x-java |
cpp | text/plain |
doc | application/msword |
dtd | text/plain |
exe | application/octet-stream |
gif | image/gif |
h++ | text/plain |
h | text/plain |
htm | text/html |
html | text/html |
ivi | application/vision |
java | text/plain |
jfif | image/pjpeg |
jpe | image/jpeg |
jpeg | image/jpeg |
jpg | image/jpeg |
m1v | video/mpg |
mov | video/quicktime |
mp2 | video/mpg |
mpa | video/mpg |
mpe | video/mpg |
mpeg | video/mpg |
mpg | video/mpg |
pac | application/x-ns-proxy-autoconfig |
application/pdf | |
pl | text/plain |
png | image/png |
pot | application/vnd.ms-powerpoint |
ppa | application/vnd.ms-powerpoint |
pps | application/vnd.ms-powerpoint |
ppt | application/vnd.ms-powerpoint |
ps | application/postscript |
pwz | application/vnd.ms-powerpoint |
qt | video/quicktime |
ra | audio/x-pn-realaudio |
ram | audio/x-pn-realaudio |
rtf | text/richtext |
sh | application/x-shar |
snd | audio/basic |
spl | application/futuresplash |
swf | application/futuresplash |
tar | application/x-tar |
text | text/plain |
tif | image/tiff |
tiff | image/tiff |
txt | text/plain |
uu | application/octet-stream |
vis | application/vision-compressed |
wav | audio/x-wav |
wax | audio/x-ms-wax |
wbmp | image/vnd.wap.wbmp |
wm | video/x-ms-wm |
wma | audio/x-ms-wma |
wmd | application/x-ms-wmd |
wml | text/vnd.wap.wml |
wmls | text/vnd.wap.wmlscript |
wmv | video/x-ms-wmv |
wmx | video/x-ms-wmx |
wmz | application/x-ms-wmz |
wrl | x-world/x-vrml |
wvx | video/x-ms-wvx |
xls | application/vnd.ms-excel |
xml | text/xml |
zip | application/x-zip-compressed |
Portal View
|
Permissions
|
Modify Keyword
|
Permissions Property Setting Code Number
|
Public | Public | PublicModify |
511
|
Public | WorkgroupPublicView | GroupModify |
509
|
Public | Owner | PublicView |
493
|
Workgroup | Workgroup | GroupModify |
504
|
Workgroup | Owner | GroupView |
488
|
Owner | Owner | PersonalModify |
448
|