cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an aspect via webservice: Help wanted please

arusellcampion
Champ in-the-making
Champ in-the-making
Dear all
I want to add an aspect to a folder using Web Services that allows an alias to be given for the folder's email id.
From http://wiki.alfresco.com/wiki/Inbound_SMTP_Email_Server_Configuration a description of how to do this through Explorer
A much more convenient method of addressing nodes is by using an email alias (Email Alias aspect or emailserver:alias). On a space or file, use the Run Action functionality to add the Email Alias aspect. Edit the space or file's properties and give the node an email alias. To set the email alias on the Space, do "View Details" on the space, in the Properties section, if Email Alias is empty, click the edit on to top right - in line with Properties to provide the alias. For example, the administrator may add a Space called Inbox to handle inbound emailed content.
How can this be done using a web service?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Just add an emailserver:alias property.   The repo will worry about adding the aspect for you.

arusellcampion
Champ in-the-making
Champ in-the-making
Hello and thanks for the reply. How do I add an emailserver:alias property? Ideally I want to do this programatically as part of a webservice call that creates a folder structure. Here's my call to add the structure:

private void createContent(HttpServletRequest request, HttpServletResponse response, String folder) throws IOException
   {
      String[] folders = {"Academic Progress","Accommodation","Admissions","Assessment","Careers and PDP","Finance","Formal Procedures","General Correspondence","Health, Wellbeing and Disability","Placements","Registration","Studentship"};
      // Start the session
      AuthenticationUtils.startSession(Attributes.USERNAME, Attributes.PASSWORD);         
      try {
         // Make your web service call in here         
         Reference r = SpaceUtil.createSpace(folder);
         for(int i=0; i<folders.length;i++){
            SpaceUtil.createSpace(r,folders[i]);
         }         
      }
      catch (Throwable e) {
         log.error("createContent erorr: " + e.toString());
         e.printStackTrace();
      }
      finally {
         // End the session
         AuthenticationUtils.endSession();
      }    
    }