001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/content/tags/sakai_2-4-1/content-api/api/src/java/org/sakaiproject/content/api/FilePickerHelper.java $
003: * $Id: FilePickerHelper.java 21027 2007-02-05 21:46:15Z john.ellis@rsmart.com $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.content.api;
021:
022: public interface FilePickerHelper {
023: /**
024: * Name of the attribute used in the tool session or state to pass a List of References back and forth to the picker.
025: * (Corresponds to ResourcesAction.STATE_ATTACHMENTS)
026: */
027: static final String FILE_PICKER_ATTACHMENTS = "sakaiproject.filepicker.attachments";
028:
029: /**
030: * The name of the state or tool-session attribute indicating that the file picker should return links to existing resources
031: * in an existing collection rather than copying them to the hidden attachments area. If this value is not set,
032: * all attachments are to copies in the hidden attachments area.
033: */
034: static final String FILE_PICKER_ATTACH_LINKS = "sakaiproject.filepicker.attachLinks";
035:
036: /**
037: * The name of the tool-session or state attribute for the maximum number of items to attach. The attribute value will be an Integer,
038: * usually CARDINALITY_SINGLE or CARDINALITY_MULTIPLE. (corresponds to ResourcesAction.STATE_ATTACH_CARDINALITY)
039: */
040: static final String FILE_PICKER_MAX_ATTACHMENTS = "sakaiproject.filepicker.maxAttachments";
041:
042: /** A constant indicating maximum of one item can be attached. */
043: public static final Integer CARDINALITY_SINGLE = new Integer(1);
044:
045: /** A constant indicating any the number of attachments is unlimited. */
046: public static final Integer CARDINALITY_MULTIPLE = new Integer(
047: Integer.MAX_VALUE);
048:
049: /**
050: * title for the file selection helper (Corresponds to ResourcesAction.STATE_ATTACH_TITLE)
051: */
052: static final String FILE_PICKER_TITLE_TEXT = "sakaiproject.filepicker.title";
053:
054: /**
055: * The name of the tool-session or state attribute for the instructions when a tool uses Resources as attachment helper
056: * (for create or attach but not for edit mode). (Corresponds to ResourcesAction.STATE_ATTACH_INSTRUCTION).
057: */
058: static final String FILE_PICKER_INSTRUCTION_TEXT = "sakaiproject.filepicker.instructions";
059:
060: /**
061: * State or Tool-Session Attribute for the ContentResourceFilter object that the current filter should honor.
062: * If this is set to null, then all files will be selectable and viewable.
063: * (Corresponds to ResourcesAction.STATE_RESOURCE_FILTER).
064: */
065: static final String FILE_PICKER_RESOURCE_FILTER = "sakaiproject.filepicker.contentResourceFilter";
066:
067: /**
068: * Name of the attribute used in the tool session to tell the consumer if this resulted in a cancel. This will be "true" or non-existent
069: * (Corresponds to ResourcesAction.STATE_HELPER_CANCELED_BY_USER).
070: */
071: static final String FILE_PICKER_CANCEL = "sakaiproject.filepicker.cancel";
072:
073: /**
074: * @deprecated use FILE_PICKER_TITLE_TEXT and FILE_PICKER_INSTRUCTION_TEXT instead
075: */
076: static final String FILE_PICKER_FROM_TEXT = "sakaiproject.filepicker.from";
077:
078: /**
079: * Not yet implemented.
080: */
081: static final String FILE_PICKER_SUBTITLE_TEXT = "sakaiproject.filepicker.subtitle";
082:
083: /**
084: * The name of the state or tool-session attribute indicating that dropboxes should be shown as places from which
085: * to select attachments. The value should be a List of user-id's. The file picker will attempt to show
086: * the dropbox for each user whose id is included in the list.
087: */
088: public static final String FILE_PICKER_SHOW_DROPBOXES = "sakaiproject.filepicker.show_dropboxes";
089:
090: /**
091: * The name of the state or tool-session attribute indicating that the current user's workspace Resources collection
092: * should be shown as places from which to select attachments. The value should be "true". The file picker will attempt to show
093: * the dropbox for each user whose id is included in the list.
094: */
095: public static final String FILE_PICKER_SHOW_WORKSPACE = "sakaiproject.filepicker.show_workspace";
096:
097: /**
098: * The name of the state or tool-session attribute indicating the id of the collection that should be shown
099: * as the default location to look for attachments for a particular invocation of the filepicker.
100: */
101: public static final String DEFAULT_COLLECTION_ID = "sakaiproject.filepicker.default_collection_id";
102:
103: /**
104: * this variable is used to tell the helper to initialize. this is optional in most cases
105: */
106: public static final String START_HELPER = "sakaiproject.filepicker.startHelper";
107:
108: }
|