Populating App Within Minutes "Database List" with entries of other App Within Minutes

I want to populate the Database List of App Within Minutes A with entries pulled from another App Within Minutes application B. This hibernate query works:

select doc.name, doc.name from XWikiDocument as doc where doc.space = 'MySpace.AppWithinMinutesSpace'

But I need to get the URL to the doc, not simply the name, so that when I view an item in A I can get the link to the referenced entry in B.

Also, is it possible to populate the Database list with custom fields from the source App Within Minutes instead of standard doc fields?

Hi!

Now i’m doing the same task: many AWM with relations (like a classic RDBMS scheme).
I’m using a Livetable as a detail list. You can use either a manually created table or a single field.

Put velocity code into Custom Display property.

For example, i’ts my terrible code :slight_smile: :slight_smile:

{{velocity}}

#set($collist = ["softID", "softType", "title1", "softVersion", "softLicense", "softComment", "softAdmins"])
#set($colprops = {
                  "softID"      : {"type" : "number"}, 
                  "softType"    : {"type" : "list", "size" : 100, "class": "SoftwareInventory.Code.SoftwareInventoryClass"},
                  "softTitle"   : {"type" : "text", "link" : "view", "sortable" : true, "filterable" : true, "html" : true},
                  "softVersion" : {"type" : "text", "size" : 10, "sortable" : true, "filterable" : true},
                  "softLicense" : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true},
                  "softAdmins"  : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true},
                  "softComment" : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true}
                 }) 
#set($options = {
                 "className" : "SoftwareInventory.Code.SoftwareInventoryClass",
                 "tagCloud"  : false,
                 "translationPrefix" : "softwareinventory.livetable.",
                 "rowCount" : 10,
                 "selectedColumn" : "softType",
                 "defaultOrder": "asc"
})

#if($context.action == 'edit') 

  #livetable("hdwLookUpSoftwareEdit" $collist $colprops $options) 

#else

  #if ($value != '()') 

   {{query query="select doc.fullName from XWikiDocument as doc, BaseObject as obj, IntegerProperty as propsoftID, StringProperty as propsoftType where 
   doc.fullName=obj.name and obj.className='SoftwareInventory.Code.SoftwareInventoryClass' and doc.fullName not like '%Template' and 
   obj.id=propsoftID.id.id and propsoftID.id.name='softID' and propsoftID.value in $value and obj.id=propsoftType.id.id and propsoftType.id.name='softType' order by 
   propsoftType.value asc" type="hql"
   class="SoftwareInventory.Code.SoftwareInventoryClass"
   columns="softTitle,softVersion,softLicense,softComment,softAdmins"
   headers="1" links="1" actions="0" /}}
 
  #else
   
    N/A
  
  #end

#end
{{velocity}}

Pay attention to Link property at
"softTitle" : {"type" : "text", "link" : "view", "sortable" : true, "filterable" : true, "html" : true},

But I need to get the URL to the doc, not simply the name

The URL is not saved into the database. You have APIs to compute the URL, e.g.

$xwiki.getURL('Path.To.Page')

Also, is it possible to populate the Database list with custom fields from the source App Within Minutes instead of standard doc fields?

See https://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HQueryLanguageExamples

@mflorea @Rostyslav_Fitsyk Thank you!

Hi,
@Rostyslav_Fitsyk
Nice.
Thank you.

How do you add the LiveTable in the AWM ?
You go in the AWM Sheet page, and add it directly (like dev) inside it ?

With this, the AWM GUI process still work : I mean, some users will be able to modify the structure of the data of the AWM, as usual, with the regular AWM tool ?