org.dspace.app.xmlui.cocoon
Class AbstractDSpaceTransformer

java.lang.Object
  extended by org.apache.cocoon.util.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.dspace.app.xmlui.wing.AbstractWingTransformer
                      extended by org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.transformation.Transformer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, DSpaceTransformer, WingTransformer, ContentHandler, LexicalHandler
Direct Known Subclasses:
AbstractSearch, AbstractStep, AddBitstreamForm, AddEPersonForm, AdvacedAuthorizationsForm, AdvancedFormTest, AssignCollectionRoles, AssignCommunityRoles, AuthorizationMain, BasicFormTest, BrowseItemForm, CannotRegister, ChoiceLookupTransformer, CollectionRecentSubmissions, CollectionSearch, CollectionViewer, CollectionViewer, CommunityBrowser, CommunityRecentSubmissions, CommunitySearch, CommunityViewer, ConfigurableBrowse, ConfirmItemForm, Contact, ControlPanel, CreateCollectionForm, CreateCommunityForm, CurateCollectionForm, CurateCommunityForm, CurateItemForm, DeleteBitstreamFormatsConfirm, DeleteBitstreamsConfirm, DeleteCollectionConfirm, DeleteCollectionRoleConfirm, DeleteCommunityConfirm, DeleteCommunityRoleConfirm, DeleteEPeopleConfirm, DeleteGroupsConfirm, DeleteMetadataFieldsConfirm, DeleteMetadataSchemaConfirm, DeletePoliciesConfirm, EditBitstreamForm, EditBitstreamFormat, EditCollectionHarvestingForm, EditCollectionMetadataForm, EditCommunityMetadataForm, EditContainerPolicies, EditEPersonForm, EditGroupForm, EditItemBitstreamsForm, EditItemMetadataForm, EditItemPolicies, EditItemStatusForm, EditMetadataSchema, EditPolicyForm, EditProfile, FailedAuthentication, FeedbackForm, FeedbackSent, FindItemForm, ForgotPasswordFinished, FormatRegistryMain, FrontPageSearch, HTMLTest, InlineFormTest, InvalidToken, ItemExport, ItemViewer, LDAPLogin, LoginChooser, ManageEPeopleMain, ManageGroupsMain, MapperMain, MetadataImportConfirm, MetadataImportMain, MetadataImportUpload, MetadataRegistryMain, MoveItemForm, MoveMetadataFields, Navigation, Navigation, Navigation, Navigation, Navigation, Navigation, Navigation, Navigation, Navigation, NotAuthorized, NoticeTransformer, PageNotFoundTransformer, PasswordLogin, ProfileUpdated, RegistrationFinished, ResetPassword, RestrictedItem, SearchItemForm, SetupCollectionHarvestingForm, StartForgotPassword, StartRegistration, StatisticsTransformer, StatisticsViewer, StepTransformer, StructureTest, Submissions, SystemwideAlerts, ToggleCollectionHarvestingForm, VerifyEmail, ViewItem, WithdrawnItems

public abstract class AbstractDSpaceTransformer
extends AbstractWingTransformer
implements DSpaceTransformer

Author:
Scott Phillips

Field Summary
protected  Context context
           
protected  String contextPath
           
protected  EPerson eperson
           
protected  org.apache.cocoon.components.flow.WebContinuation knot
           
protected  Map objectModel
           
protected  org.apache.avalon.framework.parameters.Parameters parameters
           
protected  String servletPath
           
protected  String sitemapURI
           
protected  String url
           
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
AbstractDSpaceTransformer()
           
 
Method Summary
 void addBody(Body body)
          What to add at the end of the body
 void addOptions(Options options)
          What to add to the options list
 void addPageMeta(PageMeta pageMeta)
          What page metadata to add to the document
 void addUserMeta(UserMeta userMeta)
          What user metadata to add to the document
static String decodeFromURL(String encodedString)
          Decode the given string from URL transmission.
 void dispose()
          Dispose
static String encodeForURL(String unencodedString)
          Encode the given string for URL transmission.
static String generateURL(String baseURL, Map<String,String> parameters)
          Generate a URL for the given base URL with the given parameters.
 String getComponentName()
          What is a unique name for this component?
 ObjectManager getObjectManager()
           
protected  void handleException(Exception e)
           
 void recycle()
          Recyle
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, org.apache.avalon.framework.parameters.Parameters parameters)
           
 
Methods inherited from class org.dspace.app.xmlui.wing.AbstractWingTransformer
createWingDocument, endDocument, endElement, endPrefixMapping, getDefaultMessageCatalogue, message, message, setupWing, startDocument, startElement, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

objectModel

protected Map objectModel

context

protected Context context

contextPath

protected String contextPath

servletPath

protected String servletPath

sitemapURI

protected String sitemapURI

url

protected String url

parameters

protected org.apache.avalon.framework.parameters.Parameters parameters

eperson

protected EPerson eperson

knot

protected org.apache.cocoon.components.flow.WebContinuation knot
Constructor Detail

AbstractDSpaceTransformer

public AbstractDSpaceTransformer()
Method Detail

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  Map objectModel,
                  String src,
                  org.apache.avalon.framework.parameters.Parameters parameters)
           throws org.apache.cocoon.ProcessingException,
                  SAXException,
                  IOException
Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException

handleException

protected void handleException(Exception e)
                        throws SAXException
Overrides:
handleException in class AbstractWingTransformer
Throws:
SAXException

addBody

public void addBody(Body body)
             throws SAXException,
                    WingException,
                    UIException,
                    SQLException,
                    IOException,
                    AuthorizeException
What to add at the end of the body

Specified by:
addBody in interface DSpaceTransformer
Specified by:
addBody in interface WingTransformer
Overrides:
addBody in class AbstractWingTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

addOptions

public void addOptions(Options options)
                throws SAXException,
                       WingException,
                       UIException,
                       SQLException,
                       IOException,
                       AuthorizeException
What to add to the options list

Specified by:
addOptions in interface DSpaceTransformer
Specified by:
addOptions in interface WingTransformer
Overrides:
addOptions in class AbstractWingTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

addUserMeta

public void addUserMeta(UserMeta userMeta)
                 throws SAXException,
                        WingException,
                        UIException,
                        SQLException,
                        IOException,
                        AuthorizeException
What user metadata to add to the document

Specified by:
addUserMeta in interface DSpaceTransformer
Specified by:
addUserMeta in interface WingTransformer
Overrides:
addUserMeta in class AbstractWingTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

addPageMeta

public void addPageMeta(PageMeta pageMeta)
                 throws SAXException,
                        WingException,
                        UIException,
                        SQLException,
                        IOException,
                        AuthorizeException
What page metadata to add to the document

Specified by:
addPageMeta in interface DSpaceTransformer
Specified by:
addPageMeta in interface WingTransformer
Overrides:
addPageMeta in class AbstractWingTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

getObjectManager

public ObjectManager getObjectManager()
Overrides:
getObjectManager in class AbstractWingTransformer

getComponentName

public String getComponentName()
What is a unique name for this component?

Specified by:
getComponentName in interface DSpaceTransformer
Specified by:
getComponentName in interface WingTransformer
Overrides:
getComponentName in class AbstractWingTransformer

encodeForURL

public static String encodeForURL(String unencodedString)
                           throws UIException
Encode the given string for URL transmission.

Parameters:
unencodedString - The unencoded string.
Returns:
The encoded string
Throws:
UIException

decodeFromURL

public static String decodeFromURL(String encodedString)
                            throws UIException
Decode the given string from URL transmission.

Parameters:
encodedString - The encoded string.
Returns:
The unencoded string
Throws:
UIException

generateURL

public static String generateURL(String baseURL,
                                 Map<String,String> parameters)
Generate a URL for the given base URL with the given parameters. This is a convenance method to make it easier to generate URL refrences with parameters. Example Map parameters = new Map(); parameters.put("arg1","value1"); parameters.put("arg2","value2"); parameters.put("arg3","value3"); String url = genrateURL("/my/url",parameters); would result in the string: url == "/my/url?arg1=value1&arg2=value2&arg3=value3"

Parameters:
baseURL - The baseURL without any parameters.
parameters - The parameters to be encoded on in the URL.
Returns:
The parameterized Post URL.

recycle

public void recycle()
Recyle

Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
Overrides:
recycle in class AbstractWingTransformer

dispose

public void dispose()
Dispose

Overrides:
dispose in class AbstractWingTransformer


Copyright © 2013 DuraSpace. All Rights Reserved.