Index: lams_contentrepository/doc/allclasses-frame.html =================================================================== diff -u -rc95550f73f40e3070d2e0496f7a76546065e57bc -rb2a24acef8fef98a343582d3f67f0993a76a281b --- lams_contentrepository/doc/allclasses-frame.html (.../allclasses-frame.html) (revision c95550f73f40e3070d2e0496f7a76546065e57bc) +++ lams_contentrepository/doc/allclasses-frame.html (.../allclasses-frame.html) (revision b2a24acef8fef98a343582d3f67f0993a76a281b) @@ -2,7 +2,7 @@
- +
+
+
|
++ + | +||||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + | +||||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object ++HttpServlet +
org.lamsfoundation.lams.contentrepository.client.Download +
+This is a specialised servlet that supports the downloading of single + files and the rendering of packages. + + It has a rather odd format - you can call it initially with + the file/package uuid (and optional version) using + download?uuid=<uuid>&version=<version>. + If it is a file, then the file is downloaded. If it is a package, then + it redirects to download/<uuid>/<version>/relPath + where the <uuid> and <version> are the uuid and version + of the package node. + + The download/<uuid>/<version>/relPath should only be used + internally - the servlet should be called with the parameter + version initially. + + This / format allows the relative pathed links + within an html file to work properly. + + If you want to try to download the file rather than display the file, + add the parameter preferDownload=true to the url. This is only meaningful + for a file - it is ignored for packages. + + The servlet accesses the content repository via a tool's ToolContentHandler + implementation. It looks for the bean IToolContentHandler.SPRING_BEAN_NAME + in the web based Spring context. If you do not have a ToolContentHandler + implementation then this servlet will not work. If you have an implementation + but you use a different name for the bean in the Spring context, then you + will need to override the getToolContentHandler() method in this servlet. +
+ +
+
IToolContentHandler
,
+Serialized Form+Field Summary | +|
+static java.lang.String |
+PREFER_DOWNLOAD
+
++ |
+
+static java.lang.String |
+UUID_NAME
+
++ |
+
+static java.lang.String |
+VERSION_NAME
+
++ |
+
+Constructor Summary | +|
Download()
+
++ Constructor of the object. |
+
+Method Summary | +|
+ void |
+destroy()
+
++ Destruction of the servlet. |
+
+ void |
+doGet(HttpServletRequest request,
+ HttpServletResponse response)
+
++ The doGet method of the servlet. |
+
+ void |
+doPost(HttpServletRequest request,
+ HttpServletResponse response)
+
++ The doPost method of the servlet. |
+
+ IToolContentHandler |
+getToolContentHandler()
+
++ |
+
Methods inherited from class java.lang.Object | +
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Field Detail | +
+public static final java.lang.String UUID_NAME+
+public static final java.lang.String VERSION_NAME+
+public static final java.lang.String PREFER_DOWNLOAD+
+Constructor Detail | +
+public Download()+
+
+Method Detail | +
+public void destroy()+
+
+public void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, + java.io.IOException+
+
request
- the request send by the client to the serverresponse
- the response send by the server to the client
+ServletException
- if an error occurred
+java.io.IOException
- if an error occurred+public void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, + java.io.IOException+
+
request
- the request send by the client to the serverresponse
- the response send by the server to the client
+ServletException
- if an error occurred
+java.io.IOException
- if an error occurred+public IToolContentHandler getToolContentHandler()+
+
+
|
++ + | +||||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + | +||||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +||||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + | +||||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+ToolContentHander is an abstract class that implements most of the functionality + of the interface. Each tool extends the abstract class and implements the remaining + functionality (which is tool specific). + + This interface exists so that the Download servlet (@see org.lamsfoundation.lams.contentrepository.client.Download.java) + can get to the Repository via ToolContentHandler. It needs to call the tool's + concrete class, which must be defined in the Spring context as "toolContentHandler" + (see SPRING_BEAN_NAME). The Download servlet looks for it by name, so if you change + the name, you will also need to extend the Download servlet to use your own name. + + For more details on using this class, @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler. +
+ +
+
+Field Summary | +|
+static java.lang.String |
+FILE_TYPE_PROPERTY_NAME
+
++ The "name" used to store the online/offline property in the repository |
+
+static java.lang.String |
+SPRING_BEAN_NAME
+
++ The concrete implementation must be configured as a bean in Spring, using + this value as the name. |
+
+static java.lang.String |
+TYPE_OFFLINE
+
++ File is for Offline Instructions |
+
+static java.lang.String |
+TYPE_ONLINE
+
++ File is for Online Instructions |
+
+Method Summary | +|
+ void |
+deleteFile(java.lang.Long uuid)
+
++ Delete a file node. |
+
+ IVersionedNode |
+getFileNode(java.lang.Long uuid)
+
++ Get a file node. |
+
+ java.util.Set |
+getFileProperties(java.lang.Long uuid)
+
++ Get just the properties of a file. |
+
+ char[] |
+getRepositoryId()
+
++ |
+
+ IRepositoryService |
+getRepositoryService()
+
++ |
+
+ java.lang.String |
+getRepositoryUser()
+
++ |
+
+ java.lang.String |
+getRepositoryWorkspaceName()
+
++ |
+
+ ITicket |
+getTicket(boolean forceLogin)
+
++ Get the ticket to access the repository. |
+
+ boolean |
+isOffline(IVersionedNode node)
+
++ |
+
+ boolean |
+isOnline(IVersionedNode node)
+
++ |
+
+ void |
+setRepositoryService(IRepositoryService repositoryService)
+
++ |
+
+ NodeKey |
+uploadFile(java.io.InputStream stream,
+ java.lang.String fileName,
+ java.lang.String mimeType,
+ java.lang.String fileProperty)
+
++ Save a file in the content repository. |
+
+Field Detail | +
+public static final java.lang.String TYPE_ONLINE+
+
+public static final java.lang.String TYPE_OFFLINE+
+
+public static final java.lang.String FILE_TYPE_PROPERTY_NAME+
+
+public static final java.lang.String SPRING_BEAN_NAME+
+
+Method Detail | +
+public java.lang.String getRepositoryWorkspaceName()+
+public java.lang.String getRepositoryUser()+
+public char[] getRepositoryId()+
+public ITicket getTicket(boolean forceLogin) + throws RepositoryCheckedException+
+
RepositoryCheckedException
+public NodeKey uploadFile(java.io.InputStream stream, + java.lang.String fileName, + java.lang.String mimeType, + java.lang.String fileProperty) + throws RepositoryCheckedException, + InvalidParameterException, + RepositoryCheckedException+
+
stream
- Input filestream. Mandatory.fileName
- Input filename. Mandatory.mimeType
- Mimetype of file. Optional.fileProperty
- is this for online or offline instructions? Should be TYPE_ONLINE or TYPE_OFFLINE. Mandatory.
+InvalidParameterException
- One of the mandatory parameters is missing.
+FileException
- An error occured writing the input stream to disk.
+RepositoryCheckedException
- Some other error occured.+public void deleteFile(java.lang.Long uuid) + throws InvalidParameterException, + RepositoryCheckedException+
+
uuid
- id of the file node. Mandatory
+InvalidParameterException
- One of the mandatory parameters is missing.
+RepositoryCheckedException
- Some other error occured.+public IVersionedNode getFileNode(java.lang.Long uuid) + throws ItemNotFoundException, + FileException, + RepositoryCheckedException+
+
uuid
- id of the file node. Mandatory
+FileException
- An error occured writing the input stream to disk.
+ItemNotFoundException
- This file node does not exist, so cannot delete it.
+RepositoryCheckedException
- Some other error occured.+public java.util.Set getFileProperties(java.lang.Long uuid) + throws ItemNotFoundException, + FileException, + RepositoryCheckedException+
+
uuid
- id of the file node. Mandatory
+FileException
- An error occured writing the input stream to disk.
+ItemNotFoundException
- This file node does not exist, so cannot delete it.
+RepositoryCheckedException
- Some other error occured.+public boolean isOffline(IVersionedNode node)+
+public boolean isOnline(IVersionedNode node)+
+public IRepositoryService getRepositoryService()+
+public void setRepositoryService(IRepositoryService repositoryService)+
repositoryService
- The repositoryService to set.
+
+
|
++ + | +||||||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + | +||||||||||
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
Handles the connection to the content repository, and allows a file @@ -117,15 +120,18 @@
<bean id="toolContentHandler" class="your class name here"> - <property name="repositoryService"><ref local="coreSessionFactory"/></property> + <property name="repositoryService"> <ref bean="repositoryService"/</property> </bean>+ You do not need to include repositoryService as a instance variable in your own class as it is already defined in the ToolContentHandler abstract class.
@@ -153,6 +159,13 @@
If you want to see this class used, have a look at the test code in org.lamsfoundation.lams.contentrepository.client in the test/java area. +
+ You may be wondering why we don't make the workspaceName, user, id, etc + parameters in the Spring file, rather than creating a concrete class. Using + the Spring file would be easier, but then the id (equivalent to passsword) + is easier to hack. The id is a char[], rather than a String for + security. If you don't care that your tool's id is stored as a String + then you can include it in your Spring file.
@@ -174,30 +187,15 @@
static java.lang.String
FILE_TYPE_PROPERTY_NAME
-
-Fields inherited from interface org.lamsfoundation.lams.contentrepository.client.IToolContentHandler | ||
-static java.lang.String |
-TYPE_OFFLINE
-
-- File is for Offline Instructions |
+FILE_TYPE_PROPERTY_NAME, SPRING_BEAN_NAME, TYPE_OFFLINE, TYPE_ONLINE |
-static java.lang.String |
-TYPE_ONLINE
-
-- File is for Online Instructions |
-
java.util.Set
getFileProperties(java.lang.Long uuid)
+
+abstract char[]
getRepositoryId()
@@ -274,6 +280,14 @@
ITicket
getTicket(boolean forceLogin)
+
+ boolean
isOffline(IVersionedNode node)
@@ -322,49 +336,7 @@
-
--Field Detail | -
-public static final java.lang.String TYPE_ONLINE-
-
-public static final java.lang.String TYPE_OFFLINE-
-
-public static final java.lang.String FILE_TYPE_PROPERTY_NAME-
-
getRepositoryWorkspaceName
in interface IToolContentHandler
getRepositoryUser
in interface IToolContentHandler
getRepositoryId
in interface IToolContentHandler
+public ITicket getTicket(boolean forceLogin) + throws RepositoryCheckedException+
+
getTicket
in interface IToolContentHandler
RepositoryCheckedException
@@ -443,6 +445,9 @@
uploadFile
in interface IToolContentHandler
stream
- Input filestream. Mandatory.fileName
- Input filename. Mandatory.mimeType
- Mimetype of file. Optional.fileProperty
- is this for online or offline instructions? Should be TYPE_ONLINE or TYPE_OFFLINE. Mandatory.
deleteFile
in interface IToolContentHandler
uuid
- id of the file node. Mandatory
InvalidParameterException
- One of the mandatory parameters is missing.
@@ -482,6 +490,9 @@
getFileNode
in interface IToolContentHandler
uuid
- id of the file node. Mandatory
FileException
- An error occured writing the input stream to disk.
@@ -491,12 +502,40 @@
+public java.util.Set getFileProperties(java.lang.Long uuid) + throws ItemNotFoundException, + FileException, + RepositoryCheckedException+
+
getFileProperties
in interface IToolContentHandler
uuid
- id of the file node. Mandatory
+FileException
- An error occured writing the input stream to disk.
+ItemNotFoundException
- This file node does not exist, so cannot delete it.
+RepositoryCheckedException
- Some other error occured.public boolean isOffline(IVersionedNode node)
isOffline
in interface IToolContentHandler
isOnline
in interface IToolContentHandler
getRepositoryService
in interface IToolContentHandler
setRepositoryService
in interface IToolContentHandler
repositoryService
- The repositoryService to set.
+
+
|
++ + | +||||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + | +
+
+
+
|
++ + | +||||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + | +
+
+
|
++ + | +||||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + | +
+Packages that use IToolContentHandler | +|
org.lamsfoundation.lams.contentrepository.client | ++ |
+Uses of IToolContentHandler in org.lamsfoundation.lams.contentrepository.client | +
+ +
Classes in org.lamsfoundation.lams.contentrepository.client that implement IToolContentHandler | +|
+ class |
+ToolContentHandler
+
++ Handles the connection to the content repository, and allows a file + to be stored and retrieved. |
+
+ +
Methods in org.lamsfoundation.lams.contentrepository.client that return IToolContentHandler | +|
+ IToolContentHandler |
+Download.getToolContentHandler()
+
++ |
+
+
+
+
|
++ + | +||||||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES + + + + | +
+Interfaces
+
+ +IToolContentHandler |
+
Classes
+Download + ToolContentHandler |
+Interface Summary | +|
IToolContentHandler | +ToolContentHander is an abstract class that implements most of the functionality + of the interface. | +
+ +
Class Summary | ||||||||
Download | +This is a specialised servlet that supports the downloading of single + files and the rendering of packages. | +|||||||
ToolContentHandler | Handles the connection to the content repository, and allows a file to be stored and retrieved. | Index: lams_contentrepository/doc/org/lamsfoundation/lams/contentrepository/client/package-tree.html =================================================================== diff -u -rc95550f73f40e3070d2e0496f7a76546065e57bc -rb2a24acef8fef98a343582d3f67f0993a76a281b --- lams_contentrepository/doc/org/lamsfoundation/lams/contentrepository/client/package-tree.html (.../package-tree.html) (revision c95550f73f40e3070d2e0496f7a76546065e57bc) +++ lams_contentrepository/doc/org/lamsfoundation/lams/contentrepository/client/package-tree.html (.../package-tree.html) (revision b2a24acef8fef98a343582d3f67f0993a76a281b) @@ -2,7 +2,7 @@ - +
+Packages that use org.lamsfoundation.lams.contentrepository.client | +|
org.lamsfoundation.lams.contentrepository.client | ++ |
+Classes in org.lamsfoundation.lams.contentrepository.client used by org.lamsfoundation.lams.contentrepository.client | +|
IToolContentHandler
+
+ + ToolContentHander is an abstract class that implements most of the functionality + of the interface. |
+