Kaydet (Commit) b4fc5867 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

PlaceEditDialog: simplified CMIS by adding template URLs for common servers

Change-Id: I041d58d09e132e481cfa278300c494c9f1d75f29
üst c78d7a8a
......@@ -602,6 +602,28 @@
<prop oor:name="FilePickerPlacesNames">
<value/>
</prop>
<prop oor:name="CmisServersUrls">
<value>
<it>http://&lt;host&gt;/alfresco/cmisws/RepositoryService?wsdl</it>
<it>http://&lt;host&gt;/p8cmis/wsdl</it>
<it>https://apps.lotuslive.com/files/basic/cmis/my/servicedoc</it>
<it>http://&lt;host&gt;/servlet/cmis/repository/_P&lt;Quickr place name&gt;_RMain.nsf/servicedoc</it>
<it>http://&lt;host&gt;/nuxeo/webservices/cmis/RepositoryService?wsdl</it>
<it>http://ec2-184-72-233-127.compute-1.amazonaws.com/ot-cmis/services/RepositoryService?wsdl</it>
<it>http://&lt;host&gt;/_vti_bin/CMISSoapwsdl.aspx</it>
</value>
</prop>
<prop oor:name="CmisServersNames">
<value>
<it>Alfresco 4</it>
<it>IBM FileNet P8</it>
<it>Lotus Live Files</it>
<it>Lotus Quickr Domino</it>
<it>Nuxeo 5.4</it>
<it>OpenText ELS 10.2.0</it>
<it>SharePoint 2010</it>
</value>
</prop>
</node>
<node oor:name="Save">
<node oor:name="Document">
......
......@@ -6792,6 +6792,16 @@
<desc>List of names of the places the user bookmarked in the file picker dialog.</desc>
</info>
</prop>
<prop oor:name="CmisServersUrls" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of sample URLs of the CMIS servers in the place edition dialog.</desc>
</info>
</prop>
<prop oor:name="CmisServersNames" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of names of the CMIS servers in the place edition dialog.</desc>
</info>
</prop>
</group>
<group oor:name="Forms">
<info>
......
......@@ -135,12 +135,14 @@ class CmisDetailsContainer : public DetailsContainer
private:
rtl::OUString m_sUsername;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
std::vector< rtl::OUString > m_aServerTypesURLs;
std::vector< rtl::OUString > m_aRepoIds;
rtl::OUString m_sRepoId;
Edit* m_pEDBinding;
ListBox* m_pLBRepository;
Button* m_pBTRepoRefresh;
ListBox* m_pLBServerType;
public:
CmisDetailsContainer( VclBuilderContainer* pBuilder );
......@@ -152,6 +154,7 @@ class CmisDetailsContainer : public DetailsContainer
private:
void selectRepository( );
DECL_LINK ( SelectServerTypeHdl, void * );
DECL_LINK ( RefreshReposHdl, void * );
DECL_LINK ( SelectRepoHdl, void * );
};
......
......@@ -34,6 +34,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Common.hxx>
#include <rtl/uri.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
......@@ -270,13 +271,19 @@ bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl )
CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
DetailsContainer( pBuilder, "CmisDetails" ),
m_sUsername( ),
m_xCmdEnv( )
m_xCmdEnv( ),
m_aServerTypesURLs( ),
m_aRepoIds( ),
m_sRepoId( )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xGlobalInteractionHandler(
InteractionHandler::createWithParent(xContext, 0), UNO_QUERY );
m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );
pBuilder->get( m_pLBServerType, "serverType" );
m_pLBServerType->SetSelectHdl( LINK( this, CmisDetailsContainer, SelectServerTypeHdl ) );
pBuilder->get( m_pEDBinding, "binding" );
m_pEDBinding->SetModifyHdl( LINK( this, DetailsContainer, ValueChangeHdl ) );
......@@ -287,6 +294,15 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
m_pBTRepoRefresh->SetClickHdl( LINK( this, CmisDetailsContainer, RefreshReposHdl ) );
show( false );
// Load the ServerType entries
Sequence< ::rtl::OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
Sequence< ::rtl::OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && aTypesNamesList.getLength( ); ++i )
{
m_pLBServerType->InsertEntry( aTypesNamesList[i] );
m_aServerTypesURLs.push_back( aTypesUrlsList[i] );
}
}
INetURLObject CmisDetailsContainer::getUrl( )
......@@ -341,6 +357,14 @@ void CmisDetailsContainer::selectRepository( )
notifyChange( );
}
IMPL_LINK( CmisDetailsContainer, SelectServerTypeHdl, void *, EMPTYARG )
{
// Set a sample URL for the server
sal_uInt16 nId = m_pLBServerType->GetSelectEntryPos( );
m_pEDBinding->SetText( m_aServerTypesURLs[nId] );
return 0;
}
IMPL_LINK( CmisDetailsContainer, RefreshReposHdl, void *, EMPTYARG )
{
rtl::OUString sBindingUrl = rtl::OUString( m_pEDBinding->GetText() ).trim( );
......
......@@ -6,29 +6,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkListStore" id="ServerTypes">
<columns>
<!-- column-name ServerType -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">WebDAV</col>
</row>
<row>
<col id="0" translatable="yes">FTP</col>
</row>
<row>
<col id="0" translatable="yes">SSH</col>
</row>
<row>
<col id="0" translatable="yes">Windows Share</col>
</row>
<row>
<col id="0" translatable="yes">CMIS</col>
</row>
</data>
</object>
<object class="GtkDialog" id="PlaceEditDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
......@@ -92,7 +69,7 @@
<property name="can_focus">False</property>
<property name="margin_top">6</property>
<property name="hexpand">True</property>
<property name="model">ServerTypes</property>
<property name="model">liststore1</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
......@@ -273,102 +250,128 @@
</packing>
</child>
<child>
<object class="GtkFrame" id="SmbDetails">
<object class="GtkFrame" id="CmisDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid4">
<object class="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="label9">
<object class="GtkLabel" id="bindingLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Host</property>
<property name="label" translatable="yes">Binding URL</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label10">
<object class="GtkLabel" id="repositoryLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Share</property>
<property name="label" translatable="yes">Repository</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label11">
<object class="GtkEntry" id="binding">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Path</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smbHost">
<object class="GtkGrid" id="grid6">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
<property name="can_focus">False</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkComboBox" id="repositories">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="repositoriesRefresh">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smbShare">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Server Type</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smbPath">
<object class="GtkComboBox" id="serverType">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
......@@ -378,7 +381,7 @@
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label8">
<object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Details</property>
......@@ -395,28 +398,28 @@
</packing>
</child>
<child>
<object class="GtkFrame" id="CmisDetails">
<object class="GtkFrame" id="SmbDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid5">
<object class="GtkGrid" id="grid4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="bindingLabel">
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Binding URL</property>
<property name="label" translatable="yes">Host</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -426,11 +429,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="repositoryLabel">
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Repository</property>
<property name="label" translatable="yes">Share</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -440,7 +443,21 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="binding">
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Path</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smbHost">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
......@@ -454,39 +471,11 @@
</packing>
</child>
<child>
<object class="GtkGrid" id="grid6">
<object class="GtkEntry" id="smbShare">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkComboBox" id="repositories">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="repositoriesRefresh">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -495,12 +484,26 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smbPath">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label12">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Details</property>
......@@ -657,4 +660,27 @@
<property name="can_focus">False</property>
<property name="stock">gtk-refresh</property>
</object>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name type -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">WebDAV</col>
</row>
<row>
<col id="0" translatable="yes">FTP</col>
</row>
<row>
<col id="0" translatable="yes">SSH</col>
</row>
<row>
<col id="0" translatable="yes">Windows Share</col>
</row>
<row>
<col id="0" translatable="yes">CMIS</col>
</row>
</data>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment