通过lucene搜索获取文件夹nodeRef

时间:2017-08-02 12:50:18

标签: alfresco alfresco-share alfresco-webscripts

是否有可能使用以下方法获取Alfresco文件夹的nodeRef:search.luceneSearch("PATH_OF_THE_FOLDER")

2 个答案:

答案 0 :(得分:1)

没有理由为每个结果调用findNode,因为luceneSearch调用返回一个节点数组。

如果您知道查询返回单个节点,则可以执行以下操作:

  <Grid Background="LightGray">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid Grid.Row="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="Items" Style="{StaticResource FormHeaderStyle}"/>
        <xctk:WatermarkTextBox Grid.Column="1" Name="ItemNameSearchTxt" TextChanged="ItemNameSearchTxt_TextChanged"/>
        <Button Grid.Column="2" Name="AddNewBtn" Content="Add New" Padding="20, 0" HorizontalAlignment="Right" Click="AddNewBtn_Click"/>
        <Button Grid.Column="3" Name="DeleteBtn" Content="Delete" Padding="20, 0" HorizontalAlignment="Right" Click="DeleteBtn_Click"/>
        <Button Grid.Column="4" Name="ExportBtn" Content="Export" Padding="20, 0" HorizontalAlignment="Right"/>
    </Grid>
    <Separator Grid.Row="1" Height="1" Width="Auto" VerticalAlignment="Bottom"/>
    <DataGrid Grid.Row="2" Name="ItemsDataGrid" ItemsSource="{Binding ItemDS}" IsReadOnly="True" AutoGenerateColumns="False">
        <DataGrid.Columns>
            ...
        </DataGrid.Columns>
    </DataGrid>
</Grid>

答案 1 :(得分:0)

我终于找到了解决方案。 nodeRef返回一个对象列表,所以我循环遍历此列表并获取列表元素的var folder; var nodes = search.luceneSearch("PATH:\"/app:company_home/app:dictionary/cm:StarXpert_x0020_Workflow\""); for each(node in nodes){ folder=search.findNode(node.nodeRef); } ,如下所示:

folder

现在在nodeRef我有luceneSearch返回的单个节点的import pandas as pd filename1 = 'filename1.xlsx' filename2 = 'filename2.xlsx' df1 = pd.read_excel(filename1, index_col=0) df2 = pd.read_excel(filename2, index_col=0)