Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Friday, May 11, 2012

In the Esri's ArcGIS for SharePoint SDK, you can create buttons in the SharePoint ribbon.  In this example, I will talk about the OnHidden event.  This event fires when the Hide() is called on the floating window after it is displayed.  This can be used to signal a process that the event is finished, and now you can do some other process or show another form etc...

Here I just implemented ICommand, and kept everything default.  I created a custom event EventHandler called OnHidden that will get call when the floating window is hidden or closed by a user.

    [Export(typeof(ICommand))]
    [DisplayNameAttribute("This is a Demo")]
    [DefaultIcon("/DemoFun;component/Images/Demo.png")]
    public class cmdGenerateExcelTemplate : ICommand
    {
        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
        public event EventHandler OnHidden;
     
        public void Execute(object parameter)
        {
         
            MapApplication.Current.ShowWindow("This is my control",
                 <controlobject>,
                false,
                null,
                OnHidden,
                WindowType.Floating);
            this.OnHidden += new EventHandler(cmdGenerateExcelTemplate_OnHidden);

        }

        void cmdGenerateExcelTemplate_OnHidden(object sender, EventArgs e)
        {
            MessageBox.Show("I'm hidden now!");
        }
That's It.  It's very easy to do, and helpful in some instances.

Enjoy


Wednesday, May 11, 2011

Streamlining Geo-enabled Lists for SharePoint 2010

If you use ArcGIS for SharePoint you will be creating Geo-enabled Lists multiple times.  To save time and effort, create a list template so you can reuse the same basic list structure over and over again.

1. Create a new blank and custom list

2. Name the list something memorable, like geo-enabled list
3. Add your fields to geocode against
  • Example: Address,City,State,Zip_Code

4. Add a 'ShapeX' and 'ShapeY' column as numbers
5. Add a Location Column name 'Location'
  • When Creating the location column, fill out all the geocoding information
6. Attach a geocoding workflow to the list (optional)
7. Once all your columns are added, click on list settings on the ribbon

8. Click on 'save as template'

9. Enter in a template name and save the list template

The list should now appear in the list template gallery.

Enjoy

Thursday, March 24, 2011

Two Great Books

Two great books that I've been reading lately are:
  1. Microsoft Silverlight 4 and SharePoint 2010 Integration by Packt Publishing 
  2. Expert Python Programming by Packt Publishing
I don't work for Packt nor am paid to promote any of these books.  I just like the way the material is presented.  I find the books easy to read, information is presented in a meaningful way, and the material/examples are top notch.

These are two resources any programmer should have on the old bookshelf, or in the e-reader.

Wednesday, June 23, 2010

Question for readers

I want to hear from you, leave a comment answering this question:

How do you envision GIS being used with SharePoint?

Thanks

Thursday, June 10, 2010

Spatial Web Parts with Silverlight in SharePoint 2010

In SharePoint 2010 (SP2010) you can create a silverlight web part pretty easy by just creating a custom control, then deploy the XAP file to the clientbin folder.  I should note that the pre-canned silverlight web part that I am using does not allow for DCOM bridges to be used, so to communicate between multiple silverlight web parts you would have to the Messaging API, which is quite easy, but that's for another day.

Getting Started, Open Visual Studios 2010, and create an empty SharePoint Project and a Silverlight Application.  For the Silverlight Application project ensure that the "Host the Silverlight Application in the new Web Site" is unchecked.

Now we are cooking with fire, and we can create our Silverlight application.  For this example, I will just add a map and one layer to the project. 
The next step is to place the XAP file in a location that can be used by SharePoint.  Right click on the Silverlight Application we just created and select Properties.  Click on the build tab and change the output path to: "..\..\..\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin\".  Remove the quotes when you put this into the Output Path.

Save and compile the project.  If you get any errors, it's most likely you need to reference the proper ESRI silverlight libaries.
The next step is to configure the SharePoint Project. Add a new item to the SharePoint project and select Module. Double click on the Elements.xml file.

Configure the elements file to match the above image, you need to change the path of the Url to "_layouts/clientsbin/ XAPFILENAME.XAP" and change the Path from the textfile name to the XAP file name.

Click on the module and select the Project Output Refer -> Add a member -> Choose the Silverlight Application name -> in the Deployment Type Select ElementFile -> press OK
Select Build From main toolbar -> Configuration Manager -> Uncheck all the builds except for the SharePoint Project Name and make sure the SharePoint Project has deploy checked.

Save the Project and deploy to SharePoint. 

Open your SharePoint site -> Edit Page -> Add Silverlight Web Part -> enter in the text box the following "_layouts/clientbin/XAPFILENAME.XAP".  You should now see your web part.