com.smartgwt.client.data.fields.DataSourceIntegerField Java Examples

The following examples show how to use com.smartgwt.client.data.fields.DataSourceIntegerField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AttributeOptionsDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public AttributeOptionsDS(long setId, String attribute, boolean withEmpty) {
	setRecordXPath("/list/option");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceTextField _attribute = new DataSourceTextField("attribute");
	_attribute.setHidden(true);

	DataSourceTextField value = new DataSourceTextField("value");

	DataSourceIntegerField position = new DataSourceIntegerField("position");
	position.setHidden(true);

	DataSourceTextField _templateId = new DataSourceTextField("templateId");
	_templateId.setHidden(true);

	setFields(id, _attribute, value, position, _templateId);
	setClientOnly(true);

	setDataURL("data/attributeoptions.xml?setId=" + setId + "&" + "attribute=" + attribute + "&withempty="
			+ withEmpty);
}
 
Example #2
Source File: SOSDataSource.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
public SOSDataSource(String id) {
	setID(id);
	setRecordXPath("/instances/instance");
	DataSourceIntegerField pkField = new DataSourceIntegerField("itemID");
       pkField.setPrimaryKey(true);  
	pkField.setHidden(true);

	DataSourceTextField sosURLField = new DataSourceTextField("url");
	DataSourceTextField sosVersionField = new DataSourceTextField("version");
	DataSourceBooleanField cachedField = new DataSourceBooleanField("cached");
	DataSourceTextField sosItemNameField = new DataSourceTextField("itemName");
	DataSourceBooleanField waterMLField = new DataSourceBooleanField("waterML");
	DataSourceFloatField llEastingField = new DataSourceFloatField("llEasting");
	DataSourceFloatField urEastingField = new DataSourceFloatField("urEasting");
	DataSourceFloatField llNorthingField = new DataSourceFloatField("llNorthing");
	DataSourceFloatField urNorthingField = new DataSourceFloatField("urNorthing");
	DataSourceIntegerField defaultZoomField = new DataSourceIntegerField("defaultZoom");
	DataSourceIntegerField requestChunkField = new DataSourceIntegerField("requestChunk");
	
	setFields(pkField, sosItemNameField, sosVersionField, sosURLField, waterMLField, cachedField, llEastingField, llNorthingField, urEastingField, urNorthingField, defaultZoomField, requestChunkField);
	setDataURL(SOS_INSTANCES_DATA_SOURCE);
}
 
Example #3
Source File: UserDataSource.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
public UserDataSource() {

        DataSourceIntegerField id = new DataSourceIntegerField("parameterId", "ID");
        id.setPrimaryKey(true);
        id.setHidden(true);

        DataSourceTextField userName = new DataSourceTextField("userName", i18n.userName());
        DataSourceTextField name = new DataSourceTextField("name", i18n.name());
        DataSourceTextField password = new DataSourceTextField("password", i18n.password());
        DataSourceTextField eMail = new DataSourceTextField("eMail", i18n.emailAddress());
        DataSourceTextField handy = new DataSourceTextField("handy", i18n.handyNumber());
        DataSourceTextField role = new DataSourceTextField("role", i18n.role());

        setFields(id, userName, name, password, eMail, handy, role);

        setClientOnly(true);
    }
 
Example #4
Source File: FeedMessagesDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public FeedMessagesDS() {
	setTitleField("title");
	setRecordXPath("/list/feedmessage");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setRequired(true);

	DataSourceTextField guid = new DataSourceTextField("guid");
	DataSourceTextField text = new DataSourceTextField("text");
	DataSourceTextField description = new DataSourceTextField("description");
	DataSourceTextField link = new DataSourceTextField("link");
	DataSourceDateTimeField pubDate = new DataSourceDateTimeField("pubDate");
	DataSourceIntegerField read = new DataSourceIntegerField("read");

	setFields(id, guid, text, description, link, pubDate, read);
	setClientOnly(true);
	setDataURL("data/feedmessage.xml");
}
 
Example #5
Source File: BookmarksDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public BookmarksDS() {
	setTitleField("name");
	setRecordXPath("/list/bookmark");
	DataSourceTextField name = new DataSourceTextField("name");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceImageField icon = new DataSourceImageField("icon");
	DataSourceTextField description = new DataSourceTextField("description");
	DataSourceIntegerField position = new DataSourceIntegerField("position");
	DataSourceTextField userId = new DataSourceTextField("userId");
	DataSourceTextField targetId = new DataSourceTextField("targetId");
	DataSourceTextField folderId = new DataSourceTextField("folderId");
	DataSourceIntegerField type = new DataSourceIntegerField("type");
	type.setHidden(true);

	setFields(id, name, description, icon, userId, targetId, position, folderId, type);
	setClientOnly(true);
	setDataURL("data/bookmarks.xml");
}
 
Example #6
Source File: MenusDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public MenusDS() {
	setID("MenusDS");

	setTitleField("name");
	setRecordXPath("/list/menu");
	DataSourceTextField name = new DataSourceTextField("name", I18N.message("name"), 255);

	DataSourceTextField id = new DataSourceTextField("id", I18N.message("id"));
	id.setPrimaryKey(true);
	id.setRequired(true);

	DataSourceTextField parent = new DataSourceTextField("parent", "Parent ID");
	parent.setRequired(true);
	parent.setForeignKey("MenusDS.id");
	parent.setRootValue("/");

	DataSourceIntegerField position = new DataSourceIntegerField("position", I18N.message("position"));

	setFields(name, id, position, parent);

	setDataURL("data/menus.xml");
	setClientOnly(false);
}
 
Example #7
Source File: IncrementalArchivesDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public IncrementalArchivesDS(int archivesType) {
	setTitleField("name");
	setRecordXPath("/list/archive");

	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);

	DataSourceTextField prefix = new DataSourceTextField("prefix");
	DataSourceTextField type = new DataSourceTextField("type");
	DataSourceTextField typelabel = new DataSourceTextField("typelabel");
	DataSourceIntegerField frequency = new DataSourceIntegerField("frequency");

	setFields(id, prefix, type, typelabel, frequency);
	setClientOnly(true);
	setDataURL("data/incrementalarchives.xml?locale=" + I18N.getLocale() + "&type=" + archivesType);
}
 
Example #8
Source File: DiscussionsDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public DiscussionsDS(long docId) {
	setRecordXPath("/list/discussion");
	DataSourceTextField name = new DataSourceTextField("name");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceTextField user = new DataSourceTextField("user");
	DataSourceIntegerField posts = new DataSourceIntegerField("posts");
	DataSourceIntegerField visits = new DataSourceIntegerField("visits");
	DataSourceDateTimeField lastPost = new DataSourceDateTimeField("lastPost");

	setFields(id, name, user, posts, visits, lastPost);
	setClientOnly(true);
	setDataURL("data/discussions.xml?docId=" + docId);
}
 
Example #9
Source File: ReportsDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ReportsDS() {
	setTitleField("name");
	setRecordXPath("/list/report");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	DataSourceTextField name = new DataSourceTextField("name");
	DataSourceTextField outputFolderId = new DataSourceTextField("outputFolderId");
	DataSourceTextField outputDocId = new DataSourceTextField("outputDocId");

	DataSourceImageField runningIcon = new DataSourceImageField("runningIcon");
	DataSourceIntegerField status = new DataSourceIntegerField("status");

	DataSourceImageField enabledIcon = new DataSourceImageField("enabledIcon");
	DataSourceBooleanField enabled = new DataSourceBooleanField("eenabled");

	DataSourceDateTimeField lastRun = new DataSourceDateTimeField("lastRun");
	DataSourceDateTimeField lastModified = new DataSourceDateTimeField("lastModified");

	setFields(id, name, enabled, enabledIcon, runningIcon, status, lastRun, outputFolderId, outputDocId,
			lastModified);
	setDataURL("data/reports.xml");
	setClientOnly(true);
}
 
Example #10
Source File: TicketsDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TicketsDS(Integer max) {
	setTitleField("ticketId");
	setRecordXPath("/list/ticket");

	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceTextField ticketId = new DataSourceTextField("ticketId");
	DataSourceTextField docId = new DataSourceTextField("docId");
	DataSourceTextField folderId = new DataSourceTextField("folderId");
	DataSourceDateTimeField creation = new DataSourceDateTimeField("creation");
	DataSourceDateTimeField expired = new DataSourceDateTimeField("expired");
	DataSourceIntegerField count = new DataSourceIntegerField("count");
	DataSourceIntegerField maxCount = new DataSourceIntegerField("maxCount");
	DataSourceTextField suffix = new DataSourceTextField("maxCount");
	DataSourceBooleanField valid = new DataSourceBooleanField("valid");
	DataSourceTextField fileName = new DataSourceTextField("fileName");
	DataSourceImageField icon = new DataSourceImageField("icon");
	DataSourceImageField enabled = new DataSourceImageField("eenabled");

	setFields(id, ticketId, docId, creation, expired, count, maxCount, suffix, enabled, valid, icon, fileName,
			folderId);
	setClientOnly(true);

	String url = "data/tickets.xml?1=1";
	if (max != null)
		url += "&max=" + max;
	setDataURL(url);
}
 
Example #11
Source File: FoldersDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public FoldersDS(String id, boolean nopagination) {
	String dsId = id;
	if (dsId == null)
		dsId = "FoldersDS";
	setID(dsId);
	setTitleField("name");
	setRecordXPath("/list/folder");
	DataSourceTextField name = new DataSourceTextField("name", I18N.message("name"), 255);

	DataSourceTextField color = new DataSourceTextField("color", I18N.message("color"), 255);

	DataSourceTextField recordId = new DataSourceTextField("id", I18N.message("id"));
	recordId.setPrimaryKey(true);
	recordId.setRequired(true);

	DataSourceTextField folderId = new DataSourceTextField("folderId", I18N.message("id"));
	folderId.setHidden(true);

	DataSourceTextField foldRef = new DataSourceTextField("foldRef");
	foldRef.setHidden(true);

	DataSourceIntegerField type = new DataSourceIntegerField("type", I18N.message("type"));
	type.setRequired(true);

	DataSourceFloatField size = new DataSourceFloatField("size", I18N.message("size"));

	DataSourceTextField parent = new DataSourceTextField("parent", "Parent ID");
	parent.setRequired(true);
	parent.setForeignKey(dsId + ".id");
	parent.setRootValue("/");

	setFields(recordId, name, folderId, foldRef, parent, type, size, color);

	setDataURL("data/folders.xml" + (nopagination ? "?nopagination=true" : ""));
	setClientOnly(false);
}
 
Example #12
Source File: TasksDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TasksDS() {
	setTitleField("name");
	setRecordXPath("/list/task");
	DataSourceTextField name = new DataSourceTextField("name");
	name.setPrimaryKey(true);
	name.setRequired(true);

	DataSourceImageField enabledIcon = new DataSourceImageField("enabledIcon");
	DataSourceBooleanField enabled = new DataSourceBooleanField("eenabled");
	DataSourceIntegerField status = new DataSourceIntegerField("status");
	DataSourceTextField scheduling = new DataSourceTextField("scheduling");
	DataSourceIntegerField progress = new DataSourceIntegerField("progress");
	DataSourceIntegerField progressbar = new DataSourceIntegerField("progressbar");
	DataSourceIntegerField completion = new DataSourceIntegerField("completion");
	DataSourceIntegerField size = new DataSourceIntegerField("size");
	DataSourceDateTimeField lastStart = new DataSourceDateTimeField("lastStart");
	lastStart.setRequired(false);
	DataSourceDateTimeField nextStart = new DataSourceDateTimeField("nextStart");
	nextStart.setRequired(false);
	DataSourceBooleanField indeterminate = new DataSourceBooleanField("indeterminate");
	DataSourceImageField runningIcon = new DataSourceImageField("runningIcon");

	setFields(name, enabledIcon, enabled, status, scheduling, progress, progressbar, completion, size,
			lastStart, nextStart, indeterminate, runningIcon);
	setClientOnly(false);
	setDataURL("data/tasks.xml?locale=" + I18N.getLocale());
}
 
Example #13
Source File: AttributeSetsDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public AttributeSetsDS(boolean withEmpty, Integer type) {
	setTitleField("attributeset");
	setRecordXPath("/list/attributeset");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	DataSourceTextField name = new DataSourceTextField("name");
	DataSourceTextField readonly = new DataSourceTextField("readonly");
	DataSourceIntegerField ttype = new DataSourceIntegerField("type");
	setFields(id, name, readonly, ttype);
	setDataURL("data/attributesets.xml?withempty=" + withEmpty + (type != null ? "&type=" + type : ""));
	setClientOnly(true);
}
 
Example #14
Source File: DeletedDocsDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public DeletedDocsDS(Long userId, Long folderId) {
	setTitleField("filename");
	setRecordXPath("/list/document");

	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceImageField icon = new DataSourceImageField("icon");
	DataSourceTextField customId = new DataSourceTextField("customId");
	DataSourceTextField version = new DataSourceTextField("version");
	DataSourceTextField fileVersion = new DataSourceTextField("fileVersion");
	DataSourceTextField userIdItem = new DataSourceTextField("userId");
	DataSourceTextField username = new DataSourceTextField("username");
	DataSourceFloatField size = new DataSourceFloatField("size");
	DataSourceDateTimeField lastModified = new DataSourceDateTimeField("lastModified");
	DataSourceTextField filename = new DataSourceTextField("filename");
	DataSourceTextField digest = new DataSourceTextField("digest");
	DataSourceIntegerField immutable = new DataSourceIntegerField("immutable");
	DataSourceTextField fid = new DataSourceTextField("folderId");
	DataSourceTextField type = new DataSourceTextField("type");
	DataSourceImageField locked = new DataSourceImageField("locked");
	DataSourceImageField deleteUserId = new DataSourceImageField("deleteUserId");
	DataSourceTextField deleteUser = new DataSourceTextField("deleteUser");

	setFields(id, userIdItem, username, size, version, fileVersion, lastModified, customId, icon, filename, digest,
			immutable, fid, deleteUserId, deleteUser, type, locked);
	setClientOnly(true);

	String url = "data/deleteddocs.xml?1=1";
	if (userId != null)
		url += "&userId=" + userId;
	if (folderId != null)
		url += "&folderId=" + folderId;
	setDataURL(url);
}
 
Example #15
Source File: RatingsDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public RatingsDS(Long docId) {
	setTitleField("label");
	setRecordXPath("/list/rating");

	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);

	DataSourceTextField user = new DataSourceTextField("user");
	DataSourceIntegerField vote = new DataSourceIntegerField("vote");
	DataSourceDateField date = new DataSourceDateField("date");

	setFields(id, user, vote, date);
	setDataURL("data/ratings.xml?1=1" + (docId != null ? "&docId=" + docId : ""));
	setClientOnly(true);
}
 
Example #16
Source File: LockedDocsDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public LockedDocsDS(Long userId) {
	setTitleField("filename");
	setRecordXPath("/list/document");

	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	id.setHidden(true);
	id.setRequired(true);
	DataSourceImageField icon = new DataSourceImageField("icon");
	DataSourceTextField customId = new DataSourceTextField("customId");
	DataSourceTextField version = new DataSourceTextField("version");
	DataSourceTextField fileVersion = new DataSourceTextField("fileVersion");
	DataSourceTextField userIdItem = new DataSourceTextField("userId");
	DataSourceTextField username = new DataSourceTextField("username");
	DataSourceFloatField size = new DataSourceFloatField("size");
	DataSourceDateTimeField lastModified = new DataSourceDateTimeField("lastModified");
	DataSourceTextField fileName = new DataSourceTextField("filename");
	DataSourceTextField digest = new DataSourceTextField("digest");
	DataSourceIntegerField immutable = new DataSourceIntegerField("immutable");
	DataSourceTextField folderId = new DataSourceTextField("folderId");
	DataSourceTextField type = new DataSourceTextField("type");
	DataSourceIntegerField status = new DataSourceIntegerField("status");

	setFields(id, userIdItem, username, size, version, fileVersion, lastModified, customId, icon, fileName, digest,
			immutable, folderId, type, status);
	setClientOnly(true);

	String url = "data/lockeddocs.xml";
	if (userId != null)
		url += "?userId=" + userId;
	setDataURL(url);
}
 
Example #17
Source File: TemplatesDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TemplatesDS(boolean withEmpty, Long folderId, Integer type) {
	setTitleField("template");
	setRecordXPath("/list/template");
	DataSourceTextField id = new DataSourceTextField("id");
	id.setPrimaryKey(true);
	DataSourceTextField name = new DataSourceTextField("name");
	DataSourceTextField readonly = new DataSourceTextField("readonly");
	DataSourceIntegerField documents = new DataSourceIntegerField("documents");
	DataSourceIntegerField ttype = new DataSourceIntegerField("type");
	setFields(id, name, documents, readonly, ttype);
	setDataURL("data/templates.xml?withempty=" + withEmpty + (folderId != null ? "&folderId=" + folderId : "")
			+ (type != null ? "&type=" + type : ""));
	setClientOnly(true);
}
 
Example #18
Source File: StreamProfileDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public StreamProfileDataSource() {
    setID(ID);
    setDataURL(RestConfig.URL_DIGOBJECT_STREAMPROFILE);

    DataSourceTextField fieldId = new DataSourceTextField(FIELD_ID);
    fieldId.setPrimaryKey(Boolean.TRUE);

    DataSourceTextField fieldMime = new DataSourceTextField(FIELD_MIME);
    DataSourceTextField fieldLabel = new DataSourceTextField(FIELD_LABEL);
    DataSourceIntegerField fieldOrder = new DataSourceIntegerField(FIELD_ORDER);
    fieldOrder.setHidden(true);
    setFields(fieldId, fieldMime, fieldLabel, fieldOrder);
    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example #19
Source File: NewIssueEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createForm() {
    DataSource ds = new DataSource();
    ds.setClientOnly(true);
    DataSourceIntegerField fDays = new DataSourceIntegerField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DAYS_INCLUDED_PARAM);
    fDays.setMultiple(true);
    DataSourceDateField fDateFrom = new DataSourceDateField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DATE_FROM_PARAM);
    DataSourceDateField fDateTo = new DataSourceDateField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DATE_TO_PARAM);
    DataSourceIntegerField fPartNumberFrom = new DataSourceIntegerField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_PARTNUMBER_FROM_PARAM);
    ds.setFields(fDateFrom, fDateTo, fDays, fPartNumberFrom);

    DynamicForm df = new DynamicForm();
    df.setWidth(200);
    df.setItemHoverWidth(200);
    df.setWrapItemTitles(false);
    df.setSaveOnEnter(true);

    IntegerItem partNumberStart = createPartName(fPartNumberFrom.getName());

    DateRangeValidator dateRangeValidator = new DateRangeValidator();
    DateItem dateStart = createDateFrom(fDateFrom.getName(), dateRangeValidator);

    DateItem dateEnd = new DateItem(fDateTo.getName(), i18n.NewIssueEditor_dateTo_Title());
    dateEnd.setTooltip(i18n.NewIssueEditor_dateTo_Hint());
    dateEnd.setUseTextField(true);
    dateEnd.setValidators(dateRangeValidator);
    dateEnd.setStartDate(new Date(1900 - 1900, 1, 1));

    SelectItem issueDays = createDayChooser(fDays.getName());

    df.setDataSource(ds, partNumberStart, dateStart, dateEnd, issueDays);
    return df;
}
 
Example #20
Source File: UserDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public UserDataSource() {
    setID(ID);

    ClientMessages i18n = GWT.create(ClientMessages.class);

    setDataURL(RestConfig.URL_USER);

    DataSourceIntegerField userId = new DataSourceIntegerField(FIELD_ID);
    userId.setPrimaryKey(true);
    userId.setCanEdit(false);
    userId.setHidden(true);
    userId.setTitle(i18n.UsersView_ListHeader_Id_Title());

    DataSourceTextField userName = new DataSourceTextField(FIELD_USERNAME);
    userName.setCanEdit(false);
    userName.setRequired(true);
    userName.setReadOnlyEditorProperties(new StaticTextItem());
    userName.setTitle(i18n.UsersView_ListHeader_Username_Title());
    userName.setPrompt(i18n.UsersView_ListHeader_Username_Hint());

    DataSourcePasswordField passwd = new DataSourcePasswordField(FIELD_PASSWORD);
    passwd.setHidden(true);
    passwd.setTitle(i18n.UsersView_ListHeader_Password_Title());

    DataSourceTextField surname = new DataSourceTextField(UserResourceApi.USER_SURNAME);
    surname.setRequired(true);
    surname.setTitle(i18n.UsersView_ListHeader_Surname_Title());

    DataSourceTextField forename = new DataSourceTextField(UserResourceApi.USER_FORENAME);
    forename.setTitle(i18n.UsersView_ListHeader_Forename_Title());

    DataSourceTextField organization = new DataSourceTextField(UserResourceApi.USER_ORGANIZATION);
    organization.setTitle(i18n.UsersView_ListHeader_Organization_Title());
    organization.setValueMap(Organization.getMap());
    organization.setReadOnlyEditorProperties(new StaticTextItem());

    DataSourceTextField role = new DataSourceTextField(UserResourceApi.USER_ROLE);
    role.setTitle(i18n.UsersView_ListHeader_Role_Title());
    role.setValueMap(UserRole.getMap());
    role.setReadOnlyEditorProperties(new StaticTextItem());

    DataSourceTextField email = new DataSourceTextField(UserResourceApi.USER_EMAIL);
    email.setTitle(i18n.UsersView_ListHeader_Email_Title());

    DataSourceTextField home = new DataSourceTextField(UserResourceApi.USER_HOME);
    home.setCanEdit(false);
    home.setReadOnlyEditorProperties(new StaticTextItem());
    home.setHidden(true);
    home.setTitle(i18n.UsersView_ListHeader_Home_Title());

    DataSourceDateTimeField created = new DataSourceDateTimeField(UserResourceApi.USER_CREATED);
    created.setCanEdit(false);
    created.setTitle(i18n.UsersView_ListHeader_Created_Title());
    created.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);

    DataSourceTextField remoteName = new DataSourceTextField(UserResourceApi.USER_REMOTENAME);
    remoteName.setTitle(i18n.UsersView_ListHeader_RemoteName_Title());
    remoteName.setCanEdit(false);
    remoteName.setHidden(true);

    DataSourceTextField remoteType = new DataSourceTextField(UserResourceApi.USER_REMOTETYPE);
    remoteType.setTitle(i18n.UsersView_ListHeader_RemoteType_Title());
    remoteType.setCanEdit(false);
    remoteType.setHidden(true);

    setFields(userId, userName, passwd, surname, forename, organization, role, email, created, remoteName, remoteType, home);

    setOperationBindings(RestConfig.createAddOperation(), RestConfig.createUpdateOperation());
    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example #21
Source File: WorkflowTaskDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public WorkflowTaskDataSource() {
        setID(ID);
        setDataURL(RestConfig.URL_WORKFLOW_TASK);
        final ClientMessages i18n = GWT.create(ClientMessages.class);

        allTaskStates = new LinkedHashMap<String, String>() {{
            put(State.WAITING.name(), i18n.WorkflowTask_State_Waiting_Title());
            put(State.READY.name(), i18n.WorkflowTask_State_Ready_Title());
            put(State.STARTED.name(), i18n.WorkflowTask_State_Started_Title());
            put(State.FINISHED.name(), i18n.WorkflowTask_State_Finished_Title());
            put(State.CANCELED.name(), i18n.WorkflowTask_State_Canceled_Title());
        }};
        DataSourceIntegerField fieldId = new DataSourceIntegerField(FIELD_ID);
        fieldId.setPrimaryKey(Boolean.TRUE);
        fieldId.setDetail(true);
        fieldId.setTitle(i18n.WorkflowTask_Field_Id_Title());
        fieldId.setCanEdit(false);

        DataSourceTextField label = new DataSourceTextField(FIELD_LABEL);
        label.setTitle(i18n.WorkflowTask_Field_Label_Title());
        label.setLength(255);
        label.setCanEdit(false);

        DataSourceTextField jobId = new DataSourceTextField(FIELD_JOB_ID);
        jobId.setTitle(i18n.WorkflowTask_Field_JobId_Title());
        jobId.setDetail(true);
        jobId.setCanEdit(false);

        DataSourceTextField jobLabel = new DataSourceTextField(FIELD_JOB_LABEL);
        jobLabel.setTitle(i18n.WorkflowTask_Field_JobLabel_Title());
        jobLabel.setDetail(true);
        jobLabel.setCanEdit(false);

        DataSourceEnumField state = new DataSourceEnumField(FIELD_STATE);
        state.setTitle(i18n.WorkflowTask_Field_State_Title());
        state.setValueMap(allTaskStates);
        state.setRequired(true);

        DataSourceTextField owner = new DataSourceTextField(FIELD_OWNER);
        owner.setTitle(i18n.WorkflowTask_Field_Owner_Title());
        owner.setDisplayField(WorkflowModelConsts.TASK_OWNERNAME);

        DataSourceTextField note = new DataSourceTextField(FIELD_NOTE);
        note.setTitle(i18n.WorkflowTask_Field_Note_Title());
        note.setDetail(true);

        DataSourceTextField type = new DataSourceTextField(FIELD_TYPE);
        type.setTitle(i18n.WorkflowTask_Field_Profile_Title());
        type.setDetail(true);
        type.setCanEdit(false);

        DataSourceEnumField priority = new DataSourceEnumField(FIELD_PRIORITY);
        priority.setTitle(i18n.WorkflowTask_Field_Priority_Title());
        priority.setDetail(true);
        priority.setValueMap(new LinkedHashMap() {{
            put("1", i18n.Workflow_Priority_1_Title());
            put("2", i18n.Workflow_Priority_2_Title());
            put("3", i18n.Workflow_Priority_3_Title());
            put("4", i18n.Workflow_Priority_4_Title());
        }});

        DataSourceDateTimeField created = new DataSourceDateTimeField(FIELD_CREATED);
        created.setTitle(i18n.WorkflowTask_Field_Created_Title());
        created.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
        created.setCanEdit(false);
        created.setDetail(true);

        DataSourceDateTimeField modified = new DataSourceDateTimeField(FIELD_MODIFIED);
        modified.setTitle(i18n.WorkflowTask_Field_Modified_Title());
        modified.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
        modified.setCanEdit(false);
        modified.setDetail(true);

        DataSourceField params = new DataSourceField(FIELD_PARAMETERS, FieldType.ANY);
        params.setHidden(true);

        DataSourceField materials = new DataSourceField(FIELD_MATERIALS, FieldType.ANY);
        materials.setHidden(true);

        setFields(label, type, state, priority, owner, created, modified,
                fieldId, note, jobId, jobLabel, params, materials);
        setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
        setOperationBindings(
                RestConfig.createAddOperation(),
//                RestConfig.createDeleteOperation(),
                RestConfig.createUpdatePostOperation());
    }
 
Example #22
Source File: ImportBatchItemDataSource.java    From proarc with GNU General Public License v3.0 2 votes vote down vote up
public ImportBatchItemDataSource() {
    setID(ID);

    setDataURL(RestConfig.URL_IMPORT_BATCH_ITEM);

    DataSourceField pid = new DataSourceField(FIELD_PID, FieldType.TEXT);
    pid.setPrimaryKey(true);

    DataSourceIntegerField batchId = new DataSourceIntegerField(FIELD_BATCHID);
    batchId.setPrimaryKey(true);
    batchId.setForeignKey(ImportBatchDataSource.ID + '.' + ImportBatchDataSource.FIELD_ID);

    DataSourceField timestamp = new DataSourceField(FIELD_TIMESTAMP, FieldType.TEXT);
    timestamp.setRequired(true);
    timestamp.setHidden(true);

    DataSourceTextField filename = new DataSourceTextField(FIELD_FILENAME);

    DataSourceTextField user = new DataSourceTextField(FIELD_USER);

    DataSourceTextField model = new DataSourceTextField(FIELD_MODEL);
    model.setForeignKey(MetaModelDataSource.ID + '.' + MetaModelDataSource.FIELD_PID);

    DataSourceImageField preview = new DataSourceImageField(FIELD_PREVIEW);
    preview.setImageURLPrefix(RestConfig.URL_DIGOBJECT_PREVIEW + "?");

    DataSourceImageField thumbnail = new DataSourceImageField(FIELD_THUMBNAIL);
    thumbnail.setImageURLPrefix(RestConfig.URL_DIGOBJECT_THUMBNAIL + "?");

    DataSourceField pageType = new DataSourceField(FIELD_PAGE_TYPE, FieldType.TEXT);
    DataSourceField pageTypeLabel = new DataSourceField(FIELD_PAGE_TYPE_LABEL, FieldType.TEXT);

    DataSourceField pageIndex = new DataSourceField(FIELD_PAGE_INDEX, FieldType.INTEGER, "Page Index");
    DataSourceField pageNumber = new DataSourceField(FIELD_PAGE_NUMBER, FieldType.TEXT, "Page Number");

    setFields(pid, batchId, timestamp, filename, user, model, preview, thumbnail, pageIndex, pageNumber, pageType, pageTypeLabel);

    setOperationBindings(RestConfig.createDeleteOperation());

    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));

}