FAQ
Hi Monks,

I've created some modules that'll enable me to do simple file
operations between the local machine and a remote MS Sharepoint server
(http or https via SOAP), and I need help naming my modules. As it
stands, the modules come in three parts:

Copy::GenericServiceProviderCopy
Copy::LocalFileOp
SharePoint::SPSOAP

When I was first writing my module, it was simply SharePoint::SPSOAP.
But then I realized that a lot of copy operations can be generic (my
copy function is very analogous to the linux cp -rf), whether it's an
operation on localhost or on Sharepoint. Therefore, I moved all the
generic copy steps into Copy::GenericServiceProviderCopy, and
separated location specific connector methods into Copy::LocalFileOp
and SharePoint::SPSOAP. The advantage of this is that when anyone
comes up with a entirely different proprietary server, all I have to
do is write a different connector module that provides methods for
some very basic copy functions, and Copy::GenericServiceProviderCopy
will handle the rest.

To clarify it more, by basic functions I mean file test / dir test,
single file retrieve, single file post, single file delete, and dir
creation. From these 'basic' functions,
Copy::GenericServiceProviderCopy can provide more complicated
operations like copying a directly to a directory, files and
directories into directories, file into a different file name (i.e. a
move operation), so on and so forth. Theoretically, Copy::LocalFileOp
is redundant - the file tests are the same as -f and -d in perl. I
wrote these functions into a module so that everything under
Copy::GenericServiceProviderCopy uses the same method names.

I'm sure this module will be obsolete as soon as the writers of
nautilus / konquerer come up with their own mounting mechanism for
Sharepoint services, but in the mean time, it's how I automate file
transfers, and I'm sure it will benefit a lot of sysadmins who are
policy forced to use sharepoint as an enterprise tool.

I'm looking forward to some feedback about my (in)decision in
namespace, and I welcome any comments, including mockery and disdain
for supporting proprietary vendors. If I could write a module that'll
make managers choose open source, trust me, I would.

Search Discussions

  • Brian d foy at Sep 13, 2011 at 1:50 pm
    [[ This message was both posted and mailed: see
    the "To," "Cc," and "Newsgroups" headers for details. ]]

    In article
    <CAEf1W3wrjpYaSD=HHqnak7n_k+ZgHP+75vHJ3zdMo7hif0aR-w@mail.gmail.com>, y
    s wrote:

    I've created some modules that'll enable me to do simple file
    operations between the local machine and a remote MS Sharepoint server
    (http or https via SOAP), and I need help naming my modules.
    Start with our module naming guidelines:

    https://pause.perl.org/pause/query?ACTION=pause_namingmodules

    --
    brian d foy (one of many PAUSE admins), http://pause.perl.org
    PAUSE instructions: http://pause.perl.org/pause/query?ACTION=pause_04about
    Archives: http://www.xray.mpe.mpg.de/mailing-lists/modules
    Please send all messages back to modules@perl.org with no CC to me.
  • Y s at Sep 20, 2011 at 6:17 am
    Thanks brian,

    I read through the guide and decided that I might change my modules
    from

    Copy::GenericServiceProviderCopy
    Copy::LocalFileOp
    SharePoint::SPSOAP

    to

    CopyTree::VendorProof
    CopyTree::VendorProof::LocalFileOp
    SharePoint::SOAPHandler

    For the sake of clarifying what my modules do.

    To explain by example, if I needed to copy /home/user/dir1 into Shared
    Documents/somefolder/ on SharePoint, I will need to

    1) create the Copy object
    my $copytreeobj = CopyTree::VendorProof ->new;

    2) create the local file operation object
    my $localobj = CopyTree::VendorProof->new;

    3) create the remote (sharepoint) file operation object
    my $spobj = SharePoint::SOAPHandler ->new;

    4) define items 2) and 3) as source / destination of the Copy object

    $copytreeobj ->src('/home/user/dir1', $localobj);
    $copytreeobj -> dst ('Shared Documents/somefolder', $spobj);

    5) complete the copy
    $copytreeobj ->cp();


    CopyTree::VendorProof will provide a non protocol specific object with
    methods for recursive copy, while CopyTree::VendorProof::LocalFileOp
    and SharePoint::SOAPHandler will provide protocol specific objects
    with methods for single file retrieval, single file post, single file
    delete, single directory create and delete, and file and directory
    tests.

    The protocol specific objects will have CopyTree::VendorProof in their
    @ISA

    Anyone will be able to extend this module by writing protocol specific
    parts; for example, if John has a serial device with files he wants to
    transfer, he could write
    CopyTree::VendorProof::SerialDeviceFromSomeVendor, which will
    establish an object with the same set of methods as
    CopyTree::VendorProof::LocalFileOp

    With the same method names, he will be able to copy files from his
    obscure serial device to the local file system, or to SharePoint, or
    any new service that will be sure to surface in the future.

    Why doesn't SharePoint::SOAPHandler go under CopyTree::VendorProof?
    It stands on its own because it may possibly provide more functions
    that are not related to file copying.

    I thank you again for any recommendations or suggestions.

    Y

    PS thanks for your input brian. I have 3 of your perl books and I
    definitely read the first two a couple of times. Obviously how much I
    take home is an entirely different discussion.



    On Sep 13, 7:50 am, brian.d....@gmail.com (brian d foy) wrote:
    [[ This message was both posted and mailed: see
    the "To," "Cc," and "Newsgroups" headers for details. ]]

    In article
    <CAEf1W3wrjpYaSD=HHqnak7n_k+ZgHP+75vHJ3zdMo7hif0a...@mail.gmail.com>, y

    s wrote:
    I've created some modules that'll enable me to do simple file
    operations between the local machine and a remote MS Sharepoint server
    (http or https via SOAP), and I need help naming my modules.
    Start with our module naming guidelines:

    https://pause.perl.org/pause/query?ACTION=pause_namingmodules

    --
    brian d foy (one of many PAUSE admins),http://pause.perl.org
    PAUSE instructions:  http://pause.perl.org/pause/query?ACTION=pause_04about
    Archives:http://www.xray.mpe.mpg.de/mailing-lists/modules
    Please send all messages back to modu...@perl.org with no CC to me.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodules @
categoriesperl
postedSep 11, '11 at 8:55p
activeSep 20, '11 at 6:17a
posts3
users2
websitecpan.org...

2 users in discussion

Y s: 2 posts Brian d foy: 1 post

People

Translate

site design / logo © 2021 Grokbase