Kleinere Formatierungen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@536 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e072ca1200
commit
9609ee2850
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ public class FileAttachmentMetadataProvider extends AssetMetadataProvider {
|
|||
"",
|
||||
"/redirect/", map ).getURL();
|
||||
|
||||
summary.append("A file attached to <a href=\"" + url + "\">" + title + "</a>");
|
||||
summary.append("A file attached to <a href=\"" + url + "\">" +
|
||||
title + "</a>");
|
||||
|
||||
} else {
|
||||
// draft - don't give a live link because stylesheets
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
* <P>
|
||||
* 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 <em>URLFinder</em> 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.</p>
|
||||
*
|
||||
* <p>
|
||||
* 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 <em>not</em> 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 <em>not</em> 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:</p>
|
||||
* <ol>
|
||||
* <li> User searches for objects based on keywords.
|
||||
* <li> User searches for objects based on keywords.</li>
|
||||
* <li> 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
|
||||
* <li> User clicks on one of those links.
|
||||
* .../display-result?id=:id&object_type=:object_type</li>
|
||||
* <li> User clicks on one of those links.</li>
|
||||
* <li> 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.</li>
|
||||
* </ol>
|
||||
*
|
||||
* 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();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue