Java Code Examples for com.smartgwt.client.data.fields.DataSourceTextField#setForeignKey()

The following examples show how to use com.smartgwt.client.data.fields.DataSourceTextField#setForeignKey() . 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: ShareFileDS.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ShareFileDS(boolean folders) {
	setTitleField("name");
	setRecordXPath("/list/entry");

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

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

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

	DataSourceTextField icon = new DataSourceTextField("iicon", I18N.message("icon"));

	DataSourceTextField parent = new DataSourceTextField("parent", I18N.message("parent"));
	parent.setRequired(true);
	parent.setForeignKey(getID() + ".iid");
	parent.setRootValue("#parent#");

	setFields(name, id, type, parent, icon);

	setDataURL("data/sharefile.xml?folders=" + folders);
	setClientOnly(false);
}
 
Example 2
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 3
Source File: ZohoDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ZohoDS(String id, boolean folders) {
	String dsId = id;
	if (dsId == null)
		dsId = "ZohoDS";
	setID(dsId);
	setTitleField("name");
	setRecordXPath("/list/entry");

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

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

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

	DataSourceTextField icon = new DataSourceTextField("iicon", I18N.message("icon"));

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

	setFields(name, entryId, type, parent, icon);

	setDataURL("data/zoho.xml?folders=" + folders);
	setClientOnly(false);
}
 
Example 4
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 5
Source File: DropboxDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public DropboxDS(String id, boolean folders) {
	String dsId = id;
	if (dsId == null)
		dsId = "DropboxDS";
	setID(dsId);
	setTitleField("name");
	setRecordXPath("/list/entry");

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

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

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

	DataSourceTextField icon = new DataSourceTextField("iicon", I18N.message("icon"));

	DataSourceTextField parent = new DataSourceTextField("parent", "Parent");
	parent.setRequired(true);
	parent.setForeignKey(dsId + ".path");
	parent.setRootValue("#parent#");

	setFields(name, path, type, parent, icon);

	setDataURL("data/dropbox.xml?folders=" + folders);
	setClientOnly(false);
}
 
Example 6
Source File: LinksDS.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public LinksDS(long docId) {
	setID("LinksDS");

	setTitleField("filename");
	setRecordXPath("/list/link");
	DataSourceTextField filename = new DataSourceTextField("filename");
	DataSourceTextField linkId = new DataSourceTextField("linkId");
	DataSourceTextField folderId = new DataSourceTextField("folderId");
	DataSourceTextField folderId1 = new DataSourceTextField("folderId1");
	DataSourceTextField folderId2 = new DataSourceTextField("folderId2");
	DataSourceTextField documentId = new DataSourceTextField("documentId");
	documentId.setPrimaryKey(true);
	documentId.setHidden(true);
	documentId.setRequired(true);

	DataSourceImageField icon = new DataSourceImageField("icon");
	DataSourceTextField direction = new DataSourceTextField("direction");
	DataSourceTextField type = new DataSourceTextField("type");

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

	setFields(linkId, parent, folderId, documentId, filename, icon, direction, type, folderId1, folderId2);
	setClientOnly(true);

	setDataURL("data/links.xml?docId=" + docId);
	setClientOnly(false);
}
 
Example 7
Source File: SearchDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public SearchDataSource() {
    setID(ID);
    setDataURL(RestConfig.URL_DIGOBJECT_SEARCH);

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

    DataSourceField owner = new DataSourceField(FIELD_OWNER, FieldType.TEXT);
    DataSourceField label = new DataSourceField(FIELD_LABEL, FieldType.TEXT);
    DataSourceField state = new DataSourceField(FIELD_STATE, FieldType.ENUM);
    HashMap<String, String> states = new HashMap<String, String>();
    states.put("fedora-system:def/model#Active", "Active");
    states.put("fedora-system:def/model#Inactive", "Inactive");
    states.put("fedora-system:def/model#Deleted", "Deleted");
    state.setValueMap(states);
    DataSourceDateTimeField created = new DataSourceDateTimeField(FIELD_CREATED);
    created.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
    DataSourceDateTimeField modified = new DataSourceDateTimeField(FIELD_MODIFIED);
    modified.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
    DataSourceField export = new DataSourceField(FIELD_EXPORT, FieldType.TEXT);
    DataSourceField ndkExport = new DataSourceField(FIELD_NDK_EXPORT, FieldType.TEXT);
    DataSourceField archiveExport = new DataSourceField(FIELD_ARCHIVE_EXPORT, FieldType.TEXT);
    DataSourceField krameriusExport = new DataSourceField(FIELD_KRAMERIUS_EXPORT, FieldType.TEXT);
    DataSourceField crossreffExport = new DataSourceField(FIELD_CROSSREF_EXPORT, FieldType.TEXT);
    DataSourceField organization = new DataSourceField(FIELD_ORGANIZATION, FieldType.TEXT);
    DataSourceField user = new DataSourceField(FIELD_USER, FieldType.TEXT);
    DataSourceField status = new DataSourceField(FIELD_STATUS, FieldType.TEXT);
    organization.setValueMap(Organization.getMap());
    DataSourceTextField model = new DataSourceTextField(FIELD_MODEL);
    model.setForeignKey(MetaModelDataSource.ID + '.' + MetaModelDataSource.FIELD_PID);

    setFields(label, model, pid, created, modified, owner, state, export, ndkExport, archiveExport, krameriusExport, crossreffExport, organization, user, status);
    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example 8
Source File: ImportTreeDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private ImportTreeDataSource() {
    setID(ID);

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

    DataSourceTextField path = new DataSourceTextField(FIELD_PATH);
    path.setPrimaryKey(true);
    path.setHidden(true);

    DataSourceTextField parent = new DataSourceTextField(FIELD_PARENT);
    parent.setForeignKey(FIELD_PATH);
    parent.setHidden(true);

    DataSourceTextField name = new DataSourceTextField(FIELD_NAME);

    DataSourceEnumField state = new DataSourceEnumField(FIELD_STATE);
    states.put(FolderState.IMPORTED, i18n.ImportBatchDataSource_State_LOADED());
    states.put(FolderState.NEW, "");
    states.put(FolderState.EMPTY, "");
    state.setValueMap(states);

    setFields(path, parent, name, state);
    setDataURL(RestConfig.URL_IMPORT_FOLDER);

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

}
 
Example 9
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()));

}