com.ibm.commerce.command
Class ControllerCommandImpl
java.lang.Object
CacheableCommandImpl
com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.command.ControllerCommandImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable
- Direct Known Subclasses:
- AcceptCouponFromBannerAdCmdImpl, AccountDeleteCmdImpl, AddJobCmdImpl, AddProductsToSearchSpaceCmdImpl, AdminReturnApproveCmdImpl, ApproveGroupUpdateCmdImpl, AsyncControllerCommandImpl, AttachmentViewCmdImpl, AttributeValueAddCmdImpl, AttributeValueDeleteCmdImpl, AttributeValueUpdateCmdImpl, AuctionNotificationCmdImpl, BalancePaymentCmdImpl, BatchOrderRequestCmdImpl, BidCreateFormCmdImpl, BidDeleteCmdImpl, BidSubmitCmdImpl, BidUpdateFormCmdImpl, BroadcastMessageCmdImpl, CatalogAddCmdImpl, CatalogDeleteCmdImpl, CatalogEntryAddCmdImpl, CatalogEntryDeleteCmdImpl, CatalogEntryUpdateCmdImpl, CatalogGroupAddCmdImpl, CatalogGroupDeleteCmdImpl, CatalogGroupUpdateCmdImpl, CatalogUpdateCmdImpl, CategoryDisplayCmdImpl, CatGroupCatEntryRelAddCmdImpl, CatGroupCatEntryRelDeleteCmdImpl, CatGroupRelAddCmdImpl, CatGroupRelDeleteCmdImpl, CheckForBouncedEmailCmdImpl, CleanJobCmdImpl, CompleteOrderCmdImpl, ContractAttachmentAddCmdImpl, ContractAttachmentDeleteCmdImpl, ContractCancelCmdImpl, ContractCloseCmdImpl, ContractCopyCmdImpl, ContractCreateCmdImpl, ContractDeleteCmdImpl, ContractDisplayCmdImpl, ContractListAsBuyerCmdImpl, ContractNewVersionCmdImpl, ContractResumeCmdImpl, ContractSetInSessionCmdImpl, ContractSuspendCmdImpl, ContractTCCreateCmdImpl, ContractTCDeleteCmdImpl, ContractTCSaveCmdImpl, ContractTCUpdateCmdImpl, ContractUpdateCmdImpl, CouponDSSCmdImpl, DeleteCouponsFromWalletCmdImpl, DeleteMailCmdImpl, DeployContractProcess, DisplayAuctionBidsCmdImpl, DisplayAuctionItemCmdImpl, DisplayAuctionListCmdImpl, DisplayAuctionRulesCmdImpl, DisplayMessageCmdImpl, DisplayShopperBidsCmdImpl, DoAuctionNotifyCmdImpl, DynamicKitConfigurationAddCmdImpl, EmailActivitySendCmdImpl, EmailOptOutCmdImpl, FinalizeAuctionCmdImpl, GalleryDeleteCmdImpl, GalleryDisplayCmdImpl, GetBroadcastJobStatusCmdImpl, GetJobStatusCmdImpl, GetPaymentInfoCmdImpl, GetPickPackListDetailCmdImpl, InterestItemAddCmdImpl, InterestItemDeleteCmdImpl, InterestItemDisplayCmdImpl, InterestItemListCopyCmdImpl, InterestItemListDeleteCmdImpl, LogoffCmdImpl, LogonCmdImpl, MemberGroupMemberUpdateCmdImpl, MemberLockCmdImpl, MemberRoleAssignCmdImpl, MemberRoleUnassignCmdImpl, MemberRoleUpdateCmdImpl, MonitorAuctionCmdImpl, NewInboundMessageCmdImpl, OfferAddCmdImpl, OfferDeleteCmdImpl, OfferUpdateCmdImpl, OrderCalculateCmdImpl, OrderCancelCmdImpl, OrderCopyCmdImpl, OrderItemBaseCmdImpl, OrderItemDeleteCmdImpl, OrderItemDisplayCmdImpl, OrderItemMoveCmdImpl, OrderItemSelectCmdImpl, OrderListCmdImpl, OrderProcessCmdImpl, OrderProfileUpdateCmdImpl, OrderQuotationCheckCmdImpl, OrderQuotationCreateCmdImpl, OrderQuotationDisplayCmdImpl, OrderQuotationRequestCmdImpl, OrderScheduleCmdImpl, OrderStatusCmdImpl, OrderTransferCheckCmdImpl, OrderTransferConfirmCmdImpl, OrderUnlockCmdImpl, OrgEntityRegistrationAddApprovalBaseCmdImpl, ParticipantAddCmdImpl, ParticipantDeleteCmdImpl, PayCleanupPMCmdImpl, PaymentSummaryGenerateCmdImpl, PayResetPMCmdImpl, PaySynchronizePMCmdImpl, PersistCouponForLaterUseCmdImpl, PolicyAddCmdImpl, PolicyDeleteCmdImpl, PolicyDescriptionDeleteCmdImpl, PolicyDescriptionUpdateCmdImpl, PolicyUpdateCmdImpl, ProcessBackordersCmdImpl, ProcessControllerCmdImpl, ProductAttributeAddCmdImpl, ProductAttributeDeleteCmdImpl, ProductAttributeUpdateCmdImpl, ProductDisplayCmdImpl, ProductInventoryUpdateCmdImpl, ProductListPriceUpdateCmdImpl, ProductOfferPriceUpdateCmdImpl, PunchOutCatalogDisplayCmdImpl, PunchOutSetupCmdImpl, PVCBufferUrlCmdImpl, PVCChangeDeviceCmdImpl, PVCRegisterDeviceCmdImpl, PVCRegistrationCmdImpl, RAReallocateCmdImpl, RedeemCouponCmdImpl, ReEnterPasswordCmdImpl, ReleaseExpiredAllocationsCmdImpl, ReleaseToFulfillmentCmdImpl, RemoveJobCmdImpl, RemoveProductsFromAllSearchSpacesCmdImpl, RemoveProductsFromSearchSpaceCmdImpl, RequisitionListBaseCmdImpl, ResellerRegistrationAddCmdImpl, ResetPasswordAdministratorCmdImpl, ResetPasswordCmdImpl, RetrieveShopperProfileCmdImpl, RetrieveShoppingCartCmdImpl, ReturnCancelCmdImpl, ReturnCreditAndCloseScanCmdImpl, ReturnDisplayCmdImpl, ReturnItemBaseCmdImpl, ReturnItemComponentUpdateCmdImpl, ReturnItemDeleteCmdImpl, ReturnListDisplayCmdImpl, ReturnPrepareCmdImpl, ReturnProcessCmdImpl, ReturnUpdateCmdImpl, RFQActivateAllDueCmdImpl, RFQAttachmentDeleteCmdImpl, RFQAttachmentDescUpdateCmdImpl, RFQCategoryAddCmdImpl, RFQCloseAllExpiredCmdImpl, RFQCreateForNextRoundCmdImpl, RFQItemAddCmdImpl, RFQItemCommentAddCmdImpl, RFQItemCommentRemoveCmdImpl, RFQItemCommentUpdateCmdImpl, RFQItemRemoveCmdImpl, RFQItemSpecificationAddCmdImpl, RFQItemSpecificationRemoveCmdImpl, RFQItemSpecificationUpdateCmdImpl, RFQItemUpdateCmdImpl, RFQMarkForDeleteCmdImpl, RFQModifyBasicCmdImpl, RFQNotificationMonitorBaseCmdImpl, RFQResponseProductAcceptCmdImpl, RFQResponseProductRejectCmdImpl, RFQTargetListAddCmdImpl, RFQTargetListRemoveCmdImpl, RFQTCAddCmdImpl, RFQTCRemoveCmdImpl, RFQTCUpdateCmdImpl, RFQToContractCreateCmdImpl, RFQToOrderCreateCmdImpl, RoleAddCmdImpl, SchedCouponCmdImpl, ScheduledOrderCancelCmdImpl, SearchCategoryCmdImpl, SecurityCheckCmdImpl, SendShoppingCartCmdImpl, SendTransactedMsgCmdImpl, SetCurrencyPreferenceCmdImpl, SetInterestItemListCmdImpl, SetOrderTemplateCmdImpl, SetPendingOrderCmdImpl, ShopperCreateForumMessageCmdImpl, StoreCatalogDisplayCmdImpl, StoreCollabListDisplayCmdImpl, StoreCollabMembersDisplayCmdImpl, SubmitShoppingCartCmdImpl, TempUploadCmdImpl, ToolsControllerCommandImpl, TopCatalogGroupAddCmdImpl, TopCatalogGroupDeleteCmdImpl, TopCategoriesDisplayCmdImpl, TradingAgreementImportBaseCmdImpl, UpdateGalleryCmdImpl, UpdateSearchSpacesCmdImpl, UploadToStreamCmdImpl, UseCouponIdCmdImpl, UserRegistrationAddApprovalBaseCmdImpl, UserRegistrationCmdImpl
- public class ControllerCommandImpl
- extends AbstractECTargetableCommand
- implements ControllerCommand, Protectable
An abstract base implemention for any controller command. At a minimum, a command writer has to implement its own performExecute method and set up the proper response data.
- See Also:
- Serialized Form
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, performExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters |
requestProperties
protected TypedProperty requestProperties
responseProperties
protected TypedProperty responseProperties
viewReqProperties
protected TypedProperty viewReqProperties
retriable
protected boolean retriable
ControllerCommandImpl
public ControllerCommandImpl()
- Constructor for ControllerCommandImpl.
checkPermission
public boolean checkPermission()
throws ECException
- Deprecated. Replaced by AbstractECTargetableCommand.getResources()
- Performs fine grain level access control. This is replaced by resource level access control or checkResourcePermission() in this version. Command writers should not implement this method but implement the getResources() method instead. The default implementation returns true;
-
- Specified by:
- checkPermission in interface ControllerCommand
-
- Returns:
- true if this user have permission to perform the operation on the reosurce. false if this user do not have permission to perform the operations on resource
- Throws:
- ECException
getForUserId
public java.lang.Long getForUserId()
- Gets the user Id for a customer agent command.
-
- Specified by:
- getForUserId in interface AccCommand
-
- Returns:
- the for user Id.
getGeneric
public boolean getGeneric()
- Gets the generic property for this command. A generic command is a command that can be executed by a generic user. The default implemention by ControllerCommandImpl returns 'false' for this method. Command writer needs to overwrite this method if this command can be executed by a generic user.
-
- Specified by:
- getGeneric in interface ControllerCommand
-
- Returns:
- true if this command can be called by a generic user false if this command cannot be called by a generic user
getOwner
public java.lang.Long getOwner()
throws java.rmi.RemoteException,
java.lang.Exception
- Returns the owner of this command. This method is part of the Protectable interface. This is required for command level access control where the command is the protectable resource.
-
- Specified by:
- getOwner in interface Protectable
-
- Returns:
- owner Id
- Throws:
- java.rmi.RemoteException
- java.lang.Exception
getRequestProperties
public TypedProperty getRequestProperties()
- Retrieves the request properties associated with a command.
-
- Specified by:
- getRequestProperties in interface ControllerCommand
-
- Returns:
- request properties
getResolvedRequestProperties
public TypedProperty getResolvedRequestProperties()
- Gets the resolved request properties associated with this command. This method is called after a controller command has been executed successfully. It return a a hashtable of name value pairs of interpreted request properties. This method needs to be implemented for all commands that accepts wild card parameter values and where user traffic data monitoring is desired. The default implementation returns null. The command will return only the properties with expanded parameter values.
-
- Specified by:
- getResolvedRequestProperties in interface ControllerCommand
-
- Returns:
- request properties
getResourceOwners
public java.lang.Long[] getResourceOwners()
throws ECException
- Deprecated. Replaced by AbstractECTargetableCommand.getResources()
- Gets all the organization unit that owns the resources accessed by this command. Returns null if no resource is being accessed by this command. This method was used in 5.1 for command level access control check. It is no longer required. It is kept for backward compatibility. The default implementation returns null.
-
- Specified by:
- getResourceOwners in interface AccCommand
-
- Returns:
- an array of all organization unit reference numbers a site owner is representated by an organization unit value of -1
- Throws:
- ECException
getResponseProperties
public TypedProperty getResponseProperties()
- Gets the response properties after a controller command has been executed successfully. It return a a hashtable of name value pairs. The controller command should normally return a view command name for returning response data. For example, it could contain the following properties: EC_VIEWTASKNAME (viewTaskName) - name of a view command / view task this is a required parameter EC_DOCPATHNAME (docname) - name of a jsp to be forwarded EC_TEXTDOCUMENT (textDocument)- inputStream for the text document to be returned EC_RAWDOCUMENT (rawDocument)- inputStream for the raw document to be returned EC_REDIRECTURL (redirecturl) - name of a redirect url or other additional information to be passed as requestParameters to the view command The response properties are combined with any default parameters defined in the properties column of the viewreg before passing on the the view command.
-
- Specified by:
- getResponseProperties in interface ControllerCommand
-
- Returns:
- response properties
getRetriable
public boolean getRetriable()
- Gets the retriable property for this command. A retriable command is one that should be retried on a rollback exception. The default implementation is to return false.
-
- Specified by:
- getRetriable in interface ControllerCommand
-
- Returns:
- true if this command is retriable false if this command is not retriable
getViewInputProperties
public TypedProperty getViewInputProperties()
- Gets the input properties that will be passed onto the view command. The default implementation is to return all of the request properties to the view comamnd Command writer can overwrite this method to return all, part or non of the request properties to the view command
-
- Specified by:
- getViewInputProperties in interface ControllerCommand
-
- Returns:
- request properties
isGeneric
public boolean isGeneric()
- Checks if this is a generic command. A generic command is a command that can be invoked by a generic user. The default is false for all controller commands and true for all view commands.
-
- Specified by:
- isGeneric in interface ControllerCommand
-
- Returns:
- true if this command can be called by a generic user false if this command cannot be called by a generic user
isRetriable
public boolean isRetriable()
- Checks if this command is retriable on transaction rollback exception. A retriable command will be retried once on transaction rollback exception. The default implementation is to return false.
-
- Specified by:
- isRetriable in interface ControllerCommand
-
- Returns:
- true if this command is retriable false if this command is not retriable
mergeProperties
public TypedProperty mergeProperties(TypedProperty reqProp)
- Merges the properties passedto the request with the default properties. The default behavior is to give a higher priority to the properties passed in the request. The default properties, retrieved from CMDREG is given a lower priority. Command implementators can overwrite this method if they want a different merge policy.
-
- Specified by:
- mergeProperties in interface ControllerCommand
-
- Parameters:
- reqProp - request input properties
- Returns:
- the request properties for this command
setForUserId
public void setForUserId(java.lang.Long value)
- Sets the forUserId for a customer agent command. This method is for internal use by the framework only.
-
- Specified by:
- setForUserId in interface AccCommand
-
- Parameters:
- value - userID
setGeneric
public final void setGeneric(boolean value)
- Sets the generic property of this command. The generic property is initialized by the command factory code based on the properties specified in the cmdreg table.
-
- Specified by:
- setGeneric in interface ControllerCommand
-
- Parameters:
- value - true if the command is a generic command false if this command is not a generic command
setOwner
public void setOwner(java.lang.Long value)
- Sets owner for this command for the purpose of command level access control
-
- Specified by:
- setOwner in interface AccCommand
-
- Parameters:
- value - owner Id
setRequestProperties
public void setRequestProperties(TypedProperty reqProperties)
throws ECException
- Sets the requestProperties for the command. The WebController calls the setRequestProperties method before invoking the execute method for this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the requestProperties object.
-
- Specified by:
- setRequestProperties in interface ControllerCommand
-
- Parameters:
- reqProperties - request properties
- Throws:
- com.ibm.commerce.exception.ECException.
- ECException
setResponseProperties
public void setResponseProperties(TypedProperty respProperties)
- Sets the response properties. This is called by the command to set the response properties to be returned.
-
- Parameters:
- respProperties - response properties
setRetriable
public final void setRetriable(boolean value)
- Sets the retriable properties for this command. The retriable property is initialized command factory based on the properties defined in the cmdreg table.
-
- Specified by:
- setRetriable in interface ControllerCommand
-
- Parameters:
- value - true if retriable; false otherwise
setViewInputProperties
public void setViewInputProperties(TypedProperty reqProperties)
throws ECException
- Sets the input properties to be passed to the for the view command. This is initialized to be the request properties for this command.
-
- Specified by:
- setViewInputProperties in interface ControllerCommand
-
- Parameters:
- reqProperties - request properties
- Throws:
- com.ibm.commerce.exception.ECException.
- ECException
fulfills
public boolean fulfills(java.lang.Long member,
java.lang.String relationship)
throws java.rmi.RemoteException,
java.lang.Exception
- Determines if a given member fulfills a given relationship with the resource.
-
- Specified by:
- fulfills in interface Protectable
-
- Parameters:
- member - Member id of the member
- relationship - The relationship the member has with respect to the resource
- Returns:
- true if the member fulfills the relationship with the resource
- Throws:
- RemoteException
- java.lang.Exception
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.