I'm unsure as to why you need to replace the existing file.

Can't you just create a Feature with a CustomAction element to add or override 
any elements, or did I miss something?


From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Wednesday, 4 March 2009 11:28 AM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

We did it in a second feature because the FeatureActivated event will fire 
after the actions form your elements.xml file have happened. So if you wanted 
to do it with the one feature you would find that it tried to deploy the file 
and failed, then went and deleted the file leaving you with nothing. Using a 
separate feature to delete it got us around that flaw. I suppose you could 
write the receiver to upload the file for you through code, then everything 
would be in one feature, but we decided two features that have one simple 
receiver was less complex than one feature with a more complex receiver.

Brian Farnhill
Consultant
Technical Consulting

Direct:   02 6225 4307
Main:     02 6225 4333
Mobile:   0408 289 303
Fax:      02 6225 4334
Email:    brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web:     www.uniqueworld.net<http://www.uniqueworld.net>
Blog:     blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

Microsoft Certified Application Developer
Microsoft Certified Technology Specialist: WSS 3 Application Development

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Trevor Andrew
Sent: Wednesday, 4 March 2009 11:02 AM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

Hi All / Brian,

Still on the topic of deploying my CustomSiteAction.xml file via a feature, I 
seem to have run into the issue that Brian highlighted earlier in this thread. 
As the CustomSiteAction.xml file exists in the Editing Menu folder of the 
Master Page Gallery already (as put there by the publishing feature I presume), 
the two options for IgnoreIfAlreadyExists don't help me. If set to true, then 
the file doesn't get deployed, but no error is generated. If set to false, an 
error is generated indicating the file already exists.

Brian mentioned using another feature prior to the one that deploys the file, 
to delete the existing file. What's the recommended way of deleting an existing 
file that I wish to overwrite in this situation? Do I use a simple feature 
receiver on the FeatureActivated event of this second feature to delete the 
file? Or can I simply delete the file during the FeatureActivating event of my 
original feature?

Cheers,
Trevor Andrew

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Monday, 2 March 2009 5:20 PM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

Sorry, you should be doing these in the same way - so in your feature 
elements.xml file you should have a 'module' tag that lists the files that are 
being deployed. The same theory would apply for deploying a list template and 
the XML file using this method, just change the properties to set what is being 
deployed to where.

Brian Farnhill
Consultant
Technical Consulting

Direct:   02 6225 4307
Main:     02 6225 4333
Mobile:   0408 289 303
Fax:      02 6225 4334
Email:    brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web:     www.uniqueworld.net<http://www.uniqueworld.net>
Blog:     blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

Microsoft Certified Application Developer
Microsoft Certified Technology Specialist: WSS 3 Application Development

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Trevor Andrew
Sent: Monday, 2 March 2009 5:19 PM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

Hi Brian,

Sorry if I didn't make myself clear. I'm not referring to creating a new 
library at all.

I just see an analogy between a) a feature delivering a .STP file to the List 
Template Gallery document library and b) a feature delivering an XML file 
(CustomSiteAction.xml) to the Editing Menu folder of the Master Page Gallery 
document library.  Not sure it's in any way better than delivering it via a 
module, just suggesting it as an alternative.

Cheers,
Trevor

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Monday, 2 March 2009 4:46 PM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

I'm not quite sure what you are referring to here? What does the list template 
gallery have to do with it? You are uploading one file to an existing library, 
not creating a new library

Brian Farnhill
Consultant
Technical Consulting

Direct:   02 6225 4307
Main:     02 6225 4333
Mobile:   0408 289 303
Fax:      02 6225 4334
Email:    brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web:     www.uniqueworld.net<http://www.uniqueworld.net>
Blog:     blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

Microsoft Certified Application Developer
Microsoft Certified Technology Specialist: WSS 3 Application Development

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Trevor Andrew
Sent: Monday, 2 March 2009 3:54 PM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

Hi Brian,

Thanks for that ... In another project we actually treated the List Template 
Gallery as a document library, and uploaded .STP files delivered as part of a 
feature directly into it. Could I employ a similar technique to that with this?

Cheers,
Trevor
From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Brian Farnhill
Sent: Monday, 2 March 2009 3:24 PM
To: ozmoss@ozmoss.com
Subject: RE: How to deploy CustomSiteAction.xml file via a feature

This file needs to go into the same location you got it from when you turn on 
the feature, so your module element should have a url attribute of 
"_catalogs\masterpages\Editing Menu". The catch here is that if the publishing 
feature is already turned on then you will need to delete the existing file 
first. To do this in an implementation we did recently we used one feature to 
delete to existing file and then use the second feature to put the new one in. 
I know its not a pretty solution but it does the job.

Brian Farnhill
Consultant
Technical Consulting

Direct:   02 6225 4307
Main:     02 6225 4333
Mobile:   0408 289 303
Fax:      02 6225 4334
Email:    brian.farnh...@uniqueworld.net<mailto:brian.farnh...@uniqueworld.net>
Web:     www.uniqueworld.net<http://www.uniqueworld.net>
Blog:     blog.brianfarnhill.com<http://blog.brianfarnhill.com/>

Microsoft Certified Application Developer
Microsoft Certified Technology Specialist: WSS 3 Application Development

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Trevor Andrew
Sent: Monday, 2 March 2009 2:53 PM
To: ozmoss@ozmoss.com
Subject: How to deploy CustomSiteAction.xml file via a feature

Hi All,

We are updating the CustomSiteAction.xml file in the 
_catalogs\masterpages\Editing Menu directory to modify one of the elements on 
the site action menu. This is all working fine, but I'd like to wrap up this 
change as a feature, as well as the custom page we're distributing.

I'm using WSPBuilder to build my projects, but I'm not quite sure of just where 
in the 12 hive I have to introduce this CustomSiteAction.xml file to ensure it 
gets published to the correct location when the feature is activated.

Cheers,
Trevor Andrew

________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
--------------------------------------------------------------------------------
Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Reply via email to