diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java index 02c0b6605..955d44831 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java @@ -35,7 +35,6 @@ import org.apache.log4j.Logger; * * @author sseago@redhat.com * @version $Id: FileAttachment.java 1112 2006-04-18 14:02:10Z apevec $ - * */ public class FileAttachment extends FileAsset { @@ -160,11 +159,10 @@ public class FileAttachment extends FileAsset { } /** - * This method is only used for setting initial sort keys for - * attachments which exist without them. This is called by swapKeys - * instead of attempting to swap if the key found is - * null. This implementation sorts all FileAttachments owned by this - * FileAttachment's "fileOwner" by file name. + * This method is only used for setting initial sort keys for attachments + * which exist without them. This is called by swapKeys instead of + * attempting to swap if the key found is null. This implementation sorts all + * FileAttachments owned by this FileAttachment's "fileOwner" by file name. */ public void alphabetize() { int sortKey = maxOrder(); @@ -263,7 +261,8 @@ public class FileAttachment extends FileAsset { } DataOperation operation = SessionManager.getSession() - .retrieveDataOperation("com.arsdigita.cms.contentassets.swapFileAttachmentOrder"); + .retrieveDataOperation( + "com.arsdigita.cms.contentassets.swapFileAttachmentOrder"); operation.setParameter("ownerID", fileOwner.getID()); operation.setParameter("fileOrder", currentKey); operation.setParameter("nextFileOrder", otherKey); diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java index 0c1e14dc0..822d3cf74 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java @@ -9,23 +9,33 @@ import com.arsdigita.util.parameter.Parameter; public class FileAttachmentConfig extends AbstractConfig { + /** + * A form which should be used for editing file asset properties. + * Default implementation edits Assets.description property. + */ Parameter editFormClass; + /** + * Optional parameter if set to TRUE will disply the asset URL instead of + * the description on AttachFile Authroing step. Default: FALSE + */ Parameter showAssetID; /** - * Constructor, don't use is directly! + * Constructor, don't use it directly! */ public FileAttachmentConfig() { - editFormClass = new SpecificClassParameter ("com.arsdigita.cms.contentassets.file_edit_form", - Parameter.REQUIRED, - FileDescriptionForm.class, - FormSection.class - ); - showAssetID = new BooleanParameter("com.arsdigita.cms.contentassets.file_show_asset_id", - Parameter.OPTIONAL, - Boolean.FALSE - ); + editFormClass = new SpecificClassParameter( + "com.arsdigita.cms.contentassets.file_edit_form", + Parameter.REQUIRED, + FileDescriptionForm.class, + FormSection.class + ); + showAssetID = new BooleanParameter( + "com.arsdigita.cms.contentassets.file_show_asset_id", + Parameter.OPTIONAL, + Boolean.FALSE + ); register(editFormClass); register(showAssetID); diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentInitializer.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentInitializer.java index 6dcb0ffd1..ddd3f1b59 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentInitializer.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentInitializer.java @@ -52,6 +52,11 @@ public class FileAttachmentInitializer extends ContentAssetInitializer { public void init(DomainInitEvent evt) { super.init(evt); + /* + * Register with kernel's URLservice so for an instance of it the + * complete path to its location in the sites URL tree, based on its OID, + * can be build. + */ URLService.registerFinder( FileAttachment.BASE_DATA_OBJECT_TYPE, new FileAttachmentURLFinder()); @@ -67,7 +72,7 @@ public class FileAttachmentInitializer extends ContentAssetInitializer { * their specific adapters * * chris.gilbert@westsussex.gov.uk - */ + */ MetadataProviderRegistry.registerAdapter( FileAttachment.BASE_DATA_OBJECT_TYPE, new FileAttachmentMetadataProvider()); @@ -88,13 +93,12 @@ public class FileAttachmentInitializer extends ContentAssetInitializer { } /** - * Returns the path to the XML file defintions for the - * asset, - * eg /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml + * Returns the path to the XML file defintions for the asset, eg: + * /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml */ public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/" - + "cms/contentassets/FileAttachment.xml"; + return "/WEB-INF/traversal-adapters/com/arsdigita/" + + "cms/contentassets/FileAttachment.xml"; } /** @@ -114,7 +118,7 @@ public class FileAttachmentInitializer extends ContentAssetInitializer { /** * The label for the authoring step - * @deprecated has to be replaced to provide LabelKey, see contgentAssetInitializer + * @deprecated has to be replaced to provide LabelKey, see ContentAssetInitializer */ public GlobalizedMessage getAuthoringStepLabel() { return FileAttachmentGlobalize.AuthoringStepLabel(); @@ -125,7 +129,7 @@ public class FileAttachmentInitializer extends ContentAssetInitializer { /** * The description for the authoring step - * @deprecated has to be replaced to provide DesciptionKey, see contgentAssetInitializer + * @deprecated has to be replaced to provide DesciptionKey, see ContentAssetInitializer */ public GlobalizedMessage getAuthoringStepDescription() { return FileAttachmentGlobalize.AuthoringStepDescription(); diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentMetadataProvider.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentMetadataProvider.java index a4344647b..23ec01b5d 100755 --- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentMetadataProvider.java +++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentMetadataProvider.java @@ -73,7 +73,8 @@ public class FileAttachmentMetadataProvider extends AssetMetadataProvider { "", "/redirect/", map ).getURL(); - summary.append("A file attached to " + title + ""); + summary.append("A file attached to " + + title + ""); } else { // draft - don't give a live link because stylesheets diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java index bb1096cb2..37489b992 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java @@ -119,9 +119,8 @@ public abstract class ContentAssetInitializer extends CompoundInitializer { public abstract String getBaseType(); /** - * Returns the path to the XML file defintions for the - * asset, - * eg /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml + * Returns the path to the XML file defintions for the asset, eg + * /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml */ public abstract String getTraversalXML(); diff --git a/ccm-core/src/com/arsdigita/kernel/URLService.java b/ccm-core/src/com/arsdigita/kernel/URLService.java index 43ea9291f..67ada9cb7 100755 --- a/ccm-core/src/com/arsdigita/kernel/URLService.java +++ b/ccm-core/src/com/arsdigita/kernel/URLService.java @@ -29,34 +29,32 @@ import java.util.HashMap; import javax.servlet.http.HttpServletRequest; /** - * * Supports generically locating a domain object on the site. * The URLService can produce the path (relative to the root URL) to a page * that displays the domain object identified by a given OID. *

- * The service - * works by delegating to a URLFinder based on the object type of the - * given OID. A URLFinder must be registered with the URLService for the - * object type in question or one of its supertypes. That URLFinder - * dynamically produces a URL path by a process that potentially involves - * a few database queries. + * The service works by delegating to a URLFinder based on the object + * type of the given OID. + * A URLFinder must be registered with the URLService for the object type + * in question or one of its supertypes. That URLFinder dynamically produces a + * URL path by a process that potentially involves a few database queries.

+ * *

* The URLService is only intended for single-object lookups. On pages that - * display many objects (for example, a search results page), the URLs displayed for - * each object should not be obtained from the URLService (for performance - * reasons). Instead, a single "redirector page" should be the target of - * all those links. The user clicks on a link, - * which then uses the URLService to find the object's URL - * and redirect the user to the resulting URL. An example of this process - * is: + * display many objects (for example, a search results page), the URLs displayed + * for each object should not be obtained from the URLService (for + * performance reasons). Instead, a single "redirector page" should be the target + * of all those links. The user clicks on a link, which then uses the + * URLService to find the object's URL and redirect the user to the resulting + * URL. An example of this process is:

*
    - *
  1. User searches for objects based on keywords. + *
  2. User searches for objects based on keywords.
  3. *
  4. Search page displays matching objects, with a link for each * object. The targets of these links are all the same: - * .../display-result?id=:id&object_type=:object_type - *
  5. User clicks on one of those links. + * .../display-result?id=:id&object_type=:object_type
  6. + *
  7. User clicks on one of those links.
  8. *
  9. Display-result page uses the URLService to find the specified - * object's URL and redirect the user there. + * object's URL and redirect the user there.
  10. *
* * The GenericURLFinder class provides a simple URLFinder that can be @@ -64,12 +62,11 @@ import javax.servlet.http.HttpServletRequest; * * @see GenericURLFinder * - * @author Oumi Mehrotra + * @author Oumi Mehrotra + * @version $Id: URLService.java 287 2005-02-22 00:29:02Z sskracic $ **/ public class URLService { - public static final String versionId = "$Id: URLService.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $"; - private static Map s_finders = new HashMap(); /** diff --git a/ccm-core/src/com/arsdigita/kernel/permissions/PrivilegeDescriptor.java b/ccm-core/src/com/arsdigita/kernel/permissions/PrivilegeDescriptor.java index 9a6c1d745..132a2546f 100755 --- a/ccm-core/src/com/arsdigita/kernel/permissions/PrivilegeDescriptor.java +++ b/ccm-core/src/com/arsdigita/kernel/permissions/PrivilegeDescriptor.java @@ -96,8 +96,7 @@ public class PrivilegeDescriptor { /** - * - * Adds a privilege to the system. + * Adds a privilege, identified by a name (string), to the system. * * @exception PersistenceException when there is a persistence * error in saving the new privilege. @@ -121,9 +120,16 @@ public class PrivilegeDescriptor { return desc; } - public static void addChildPrivilege( - String privilegeName, - String childPrivilegeName) { + /** + * Sets up a tree structure of privileges, if privilegeName is granted, + * it includes child PrivilegeName as well. + + * @param privilegeName privilege name will include another privilege + * @param childPrivilegeName privilege name is included by priv...Name. + */ + public static void addChildPrivilege( String privilegeName, + String childPrivilegeName) { + DataOperation addOp = SessionManager.getSession().retrieveDataOperation( "com.arsdigita.kernel.permissions.addChildPrivilege"); @@ -303,9 +309,9 @@ public class PrivilegeDescriptor { } /** - * * Determine whether or not this privilege is implied by the * specified privilege. + * * @return true if the privilege on which this method is invoked * is implied by the specified privilege, false otherwise */