image, category and default album config files

Last post 03-31-2011, 9:36 AM by globosoft. 4 replies.
Sort Posts: Previous Next
  •  03-30-2011, 9:16 AM 66925

    image, category and default album config files

    The demo's look great but I have not seen via the demo source or support document answers to the below questions.
     
    How can I access, read, write display the "properties" attributes found in the config files shown below?
     
    Also, what about userid attribute, can that be accessed?
     
    And how would a developer set username attribute to something other then (Guest)?
     
    Lastly, I notice that many of the responses show examples where C# is used to access the DotNetGallery. Are there any examples and is it possibly to access the DotNetGallery via VB.NET?
     
    image config file
    <photo properties="" >
      <comment userid="" username="(Guest)" />
    </photo>
    category config file
    <category description="" properties="">
      <comment userid="" username="(Guest)"  />
    </category>
     
    default album config
    <album name="(Default Album)" nextcategoryid="4" lastPhotoTime="2011-03-30 02:05:01">
      <category id="1" />
      <category id="3" />
    </album>
     
  •  03-31-2011, 1:04 AM 66932 in reply to 66925

    Re: image, category and default album config files

    Hi globosoft,
     
    1. How can I access, read, write display the "properties" attributes found in the config files shown below?
     
    The example below shows you how the get the properties of photo
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>  
    4.   
    5. <script runat="server">  
    6.     void Page_Load(object sender, EventArgs e)  
    7.     {  
    8.         gallery1.AllowEdit = true;  
    9.         gallery1.AllowPostComment = true;  
    10.         gallery1.AllowShowComment = true;  
    11.   
    12.         using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))  
    13.         {  
    14.             //get all categories  
    15.   
    16.             string[] categoryArray = provider.GetCategoryArray();  
    17.             for (int i = 0; i < categoryArray.Length; i++)  
    18.             {  
    19.                 //get all photos  
    20.                 string[] photoArray = provider.GetPhotoArray(categoryArray[i]);  
    21.                 string categoryID = categoryArray[i];  
    22.                 string photoID;  
    23.                 for (int j = 0; j < photoArray.Length; j++)  
    24.                 {  
    25.                     photoID = provider.GetPhotoArray(categoryArray[i])[j];  
    26.                     string title;  
    27.                     string comment;  
    28.                     int width;  
    29.                     int height;  
    30.                     int fileSize;  
    31.                     string ipaddress;  
    32.                     string propexpr;  
    33.                     DateTime time;  
    34.                     provider.GetPhotoInfo(categoryID, photoID, out title, out comment, out width, out height, out fileSize, out ipaddress, out propexpr, out time);  
    35.                     label1.Text += (title + "-" + comment + width.ToString() + "-" + height.ToString() + "-" + fileSize.ToString() + "-" + ipaddress + "-" + propexpr + "-" + time.ToString() + "<br/>");  
    36.   
    37.                 }  
    38.   
    39.             }  
    40.         }  
    41.     }  
    42.    
    43. </script>  
    44.   
    45. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  
    46. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
    47. <head runat="server">  
    48.     <title></title>  
    49. </head>  
    50. <body>  
    51.     <form id="form1" runat="server">  
    52.         <asp:Label ID="label1" runat="server"></asp:Label>  
    53.         <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Admin Console</a>  
    54.         <DotNetGallery:GalleryBrowser runat="server" ID="gallery1" Width="720" Height="430" />  
    55.     </form>  
    56. </body>  
    57. </html> 
     2. Also, what about userid attribute, can that be accessed?
     
    Can you show me which property you mean? (there is not a userid property in the config file)
     
    3. And how would a developer set username attribute to something other then (Guest)?
     
    Please explain this requirement on detail too.
     
    4. Lastly, I notice that many of the responses show examples where C# is used to access the DotNetGallery. Are there any examples and is it possibly to access the DotNetGallery via VB.NET?
     
    Below is a vb.net example to shows you how to access the property of gallery
    1. <%@ Page Language="VB" %>  
    2.   
    3. <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.   
    8.     Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs)  
    9.         gallery1.AllowEdit = True  
    10.         gallery1.AllowPostComment = True  
    11.         gallery1.AllowShowComment = True  
    12.     End Sub  
    13. </script>  
    14.   
    15. <html xmlns="http://www.w3.org/1999/xhtml">  
    16. <head runat="server">  
    17.     <title>Untitled Page</title>  
    18. </head>  
    19. <body>  
    20.     <form id="form1" runat="server">  
    21.         <div>  
    22.             <DotNetGallery:GalleryBrowser runat="server" ID="gallery1" Width="720" Height="430" />  
    23.         </div>  
    24.     </form>  
    25. </body>  
    26. </html> 
    Regards,
     
    Ken
  •  03-31-2011, 1:53 AM 66933 in reply to 66925

    Re: image, category and default album config files

    First thanks for getting back with some answers so quickly. That's awesome!
     
     2. Also, what about userid attribute, can that be accessed?
    Can you show me which property you mean? (there is not a userid property in the config file)
    GloboSoft:
    The userid is located in the comment lines of the image config files and the category files..
     
    3. And how would a developer set username attribute to something other then (Guest)?
    Please explain this requirement on detail too.
    GloboSoft
    I have users who are General Admins, Super Admins or just standard users. I was wondering how to set this username to the usernames of my different users when the entered comments for uploaded images or when new categories were created..
     
    I also need  to meet these requirements:
     
    1. Be able to upload images with multiple file select.
     
    2. images need to be grouped/identified by two categories. (for us, the categories are propertyID and user. So each image belongs to a propertyID and a user. we need to be able to view all the pictures by a propertyID and by a user. Or we can view all the pictures by simply a propertyID. When upload, we can specified what propertyID and user this picture belongs to)
     
    3. ASP.NET DLL/Ajax control
     
    4. interface with sql server store procedures. We store file names into sql database via store procedures....

  •  03-31-2011, 3:58 AM 66935 in reply to 66933

    Re: image, category and default album config files

    Hi globosoft,
     
    About the userID question
     
    You can specify the User by property "LogonUserName"; Like
     
    gallery1.LogonUserName = "ken";
    gallery1.LogonUserName = Context.User.Identity.Name;
     
    ---------------------------------------------------------------------------------------
    1. Be able to upload images with multiple file select.
     
    It is the default function of DotNetGallery
     
    2. images need to be grouped/identified by two categories. (for us, the categories are propertyID and user. So each image belongs to a propertyID and a user. we need to be able to view all the pictures by a propertyID and by a user. Or we can view all the pictures by simply a propertyID. When upload, we can specified what propertyID and user this picture belongs to)
     
    You can display the pictures by categoryID, like
     
     gallery1.CategoryID = "1";
     
     
    3. ASP.NET DLL/Ajax control
     
    For now does not support it. like UpdatePanel.
     
    4. interface with sql server store procedures. We store file names into sql database via store procedures....
    You can handle this logic in the image upload event
     
      protected void gallery1_PostProcessImage(object sender, GalleryImageEventArgs args)
        {
     
            //image name
            args.Title;

        }
     
    Regards,
     
    Ken
  •  03-31-2011, 9:36 AM 66940 in reply to 66925

    Re: image, category and default album config files

    2. images need to be grouped/identified by two categories. (for us, the categories are propertyID and user. So each image belongs to a propertyID and a user. we need to be able to view all the pictures by a propertyID and by a user. Or we can view all the pictures by simply a propertyID. When upload, we can specified what propertyID and user this picture belongs to)
     
    You can display the pictures by categoryID, like
     
     gallery1.CategoryID = "1";
     
    GloboSoft:
    Yes I saw that ability. But I also need to group them not only by which user uploaded them but also by which property the image is associated with. Right now the only way I see to do this is to have the images for each property uploaded to a different GalleryFolder. But the client wants all the images stored in a single folder with the image name changed to reflect the property that it belongs with.
     
    It's an existing project with many images already loaded this way (meaning all images are located in a single image property directory a then image name is created based on the propertyID and a Guid.NewGuid) so changing how the images are stored at this point is not something the client wants done. Plus there a thousands of new properties and associated images being loaded daily and the project manager is indicating that placing images in multiple directories is not acceptable.
     
    I do see how I could definitely use this DotNetGallery component on some of my other websites.
     
    I will evaluate your product further and decide on whether to go with a single or domain licensing.
     
    Thank you for your quick responses.
     
     
View as RSS news feed in XML