Saturday, June 8, 2013

Server Error: You are not authorized to use the server at lotus domino

Server Error: You are not authorized to use the server.

While setting up an additional server in a Domain, the following error occurs when you click the Finish button at the end of the server Setup configuration as the additional server is attempting to pull the Domino Directory from the Primary server:

Server Error: You are not authorized to use the server.



You are not authorized to use the server


Solutions:

In at least one case, the "Access Server" field on the Security tab of the Server document of the primary server had the "Users listed in all trusted directories" field checked. This option will allow all users who have Person documents in either in the Primary Domino directory or any secondary Domino directories to access the primary server. This will prevent access to the newly-registered server.
Disabling this option for the duration of the new server configuration allowed the setup to complete without error. Once the new server setup is complete you can restore this option.
Removing the check from "Users listed in all trusted directories" is required and the value in "and" field is required to be cleared.
In anothor case, the user had the "Check password on notes ID's" field set to Yes. Setting this field to No allowed the server setup to complete.


Friday, June 7, 2013

Setting up DOLS on a Lotus Domino Server


Setting up DOLS on a server 

IBM® Lotus® Domino™ Off-Line Services (DOLS) must be configured on the Domino server for users to be able to take applications off-line and use only a browser to work with them. You can enable any application for DOLS. The following templates are enabled for DOLS by default:
  • IBM® Lotus® Domino™ Web Access (MAIL8.NTF, DWA7.NTF, and iNOTES6.NTF)
  • Discussion - IBM® Lotus® Notes® and Web (R7) database (DISCSW7.NTF)

To configure DOLS during Domino Server Setup
1. Under "Setup Internet services for," select "Web Browsers (HTTP services)," and then click Customize.
2. In the "Domino tasks" list, select "DOLS Domino Off-Line Services."
3. At the end of setup, when you have the option to create an access control list entry, add the group LocalDomainAdmins to all databases and templates.
4. Accept the default option "Prohibit Anonymous access to all databases and templates." If you deselect this option, you must open the ACL for each DOLS application and assign No Access to Anonymous.
5. Make sure the following names are identical:
      • The TCP/IP DNS host name -- In Microsoft® Windows®, choose Start - Programs - Windows Explorer. Then choose Network Neighborhood properties - TCP/IP properties. On the DNS Configuration tab, look at the Host field.
      • The server name -- Open the Server document and look at the Server name field.
      • The Internet host name -- Open the Server document and look at the "Fully qualified Internet host name" field.
Note DOLS runs on Domino servers configured to work through a Microsoft IIS server.
To configure DOLS manually
If you do not configure DOLS during Domino Server Setup, you can configure DOLS manually by editing the Server document.
1. Open the Server document.
2. Click Internet Protocols - HTTP.
3. In the "DSAPI filter file names" field, enter the DSAPI filter file name that corresponds to the operating system that the server is running, and then restart the server:
      • Microsoft Windows - ndolextn
      • Linux® - libdolextn
      • IBM® AIX® - libdolextn
      • Solaris/Sparc - libdolextn
      • S390® - libdolextn
      • iSeries® - libdolextn
    Note On the iSeries platform, the Server document is updated when a new server is configured or an existing server is modified using the CFGDOMSVR or CHGDOMSVR CL command with DOLS(*YES) specified.

4. Create a DOLADMIN.NSF database from the template DOLADMIN.NTF.
5. After the database is created, restart the Domino administrator and click the Configuration tab. The name of the DOLADMIN.NSF is an option in the Navigation pane.
To set up DOLS on clustered servers
Before using DOLS on a clustered Domino server, make sure that:
      • The Domino server is either a Domino Utility Server or Domino Enterprise Server.
      • All servers in the cluster run the same release of Domino with DOLS
      • Clustered server management is running to handle both failover of replication and HTTP
      • Internet Cluster Manager is running
      • Subscription directories must have the same name on every clustered server. For example, if a subscription is under \data\Webmail user\7CD5957CB669AE2285256BDF00567AD8\, this name cannot be different on a different server in the cluster.
To configure DOLS on a server that uses Web Site documents
If you create a Web Site Document (a type of Internet Site document) on the Domino server, you must add the appropriate DOLS DSAPI filter filename to the DSAPI field in the Web Site document for DOLS to be enabled. If there are several Web Site documents, you must add the DSAPI filter filename to each one. To add the DOLS DSAPI filter filename to a Web Site document:
1. Open the Web Site document.
2. Click the Configuration tab.
3. In the "DSAPI filter" field, enter the DSAPI filter file name that corresponds to the operating system that the server is running, and then restart the server:
      • Win32 - ndolextn
      • Linux - libdolextn
      • IBM® AIX® - libdolextn
      • Solaris/Sparc - libdolextn
      • S390 - libdolextn
      • iSeries - libdolextn
For more information on Internet Site documents, see the topic "Configuring Internet sites with Web Site and Internet Site documents."
See also

Sunday, June 2, 2013

Connecting to .NET web service from Android

Connecting to .NET web service from Android

If you are having trouble using .NET Web Services with the Android Platform, you have probably reached to the solution here.

I am here demonstrating the steps using which you can consume data from the .NET web service in your android app. In order to use .Net web Service from your android application you need to first download the ksoap2 android API. Follow the link to download ksoap2 API for android.

After downloading the API, extract the zip file to the file system. Open your Android Project and navigate to the Project Properties. In the project properties go to Java Build Path and say Add External JARs.

Add the reference to the extracted ksoap2-j2se-full-2.1.2.jar file from the downloaded API. You are now ready to use ksoap2 to connect to the .NET web service via Android.

Let’s assume a .NET web service with two methods “Hello World” that returns a string and “Add” that accepts two numbers and returns their sum. Following is the WSDL file of the web service.

From the above WSDL file we get the following Information about the web service:
  • NameSpace: http://localhost/TestWebService/
  • Web Service URl: http://TestServer/Test/Service.asmx
  • Method “Hello World” SoapAction URL: http://localhost/TestWebService/HelloWorld
  • Method “Hello World” Output Type: String
  • Method “Add” SoapAction URL: http://localhost/TestWebService/Add
  • Method Hello World Input Type: Int, Int
  • Method Hello World Output Type: Int
In order to use this Web Service with our android app:
  1. Open the java file from where you would like to access the Web Service
  2. Include the class library for ksoap2

    import org.ksoap2.*;
    import org.ksoap2.serialization.*;
    import org.ksoap2.transport.*;
    import org.w3c.dom.Text;

  3. Define Web Service Properties in the class

    private static final String NAMESPACE = "http://localhost/TestWebService/";
    private static final String URL = " http://TestServer/Test/service.asmx";
    private static finaString HelloWorld_SOAP_ACTION ="http://localhost/TestWebService/HelloWorld";
    private static final String METHOD_NAME1 = "HelloWorld";
    private static final String Add_SOAP_ACTION ="http://localhost/TestWebService/Add";
    private static final String METHOD_NAME2 = "Add";

  4. Add methods to call the web service methods and retrieve the results

    public void GetHelloWorld() {

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);
    SoapSerializationEnvelope envelope =
    new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    try
    {
    androidHttpTransport.call(HelloWorld_SOAP_ACTION, envelope);
    java.lang.String receivedString = (String)envelope.getResponse();

    }
    catch(Exception e)
    {
    }

    }
    public void GetAdd() {

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME2);

    PropertyInfo num1 = new PropertyInfo();
    num1.setName("a");
    num1.setValue(5);
    request.addProperty(num1);

    PropertyInfo num2 = new PropertyInfo();
    num2.setName("b");
    num2.setValue(9);
    request.addProperty(num2);

    SoapSerializationEnvelope envelope =
    new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    try
    {
    androidHttpTransport.call(Add_SOAP_ACTION, envelope);
    java.lang.Integer receivedInt = (Integer)envelope.getResponse();

    }
    catch(Exception e)
    {
    }

    }

  5. If you app require access to an array, you can use the following code:

    ArrayList<String> a = new ArrayList<String>();
    try
    {
    androidHttpTransport.call(SOAP_ACTION, envelope);
    java.util.Vector<Object> receivedStrings = (java.util.Vector<Object>)envelope.getResponse();
    if(receivedStrings != null)
    {
    for(Object curStrings : receivedStrings)
    {
    a.add(curStrings.toString());
    }
    }
    }
    catch(Exception e)
    {
    }
I hope the above steps helps you if this is what you are looking for.

Reference by : http://composedcrap.blogspot.com/2009/08/connecting-to-net-web-service-from.html

Wednesday, May 29, 2013

Lotus domino user information export to excel


Lotus domino user  information export to excel


You can export domino users using following steps:
1. Create Agent
2. Run Agent

Create Agent:

Using two way you can create agent:
1. On Live server , open domino admin -> go to peoples->click Create->Agent->Put name(All User export) -Select type: Java- OK

-Open java file and paste the below code and Save it

2. If you don't want to do on live server, then copy the names.nsf file to your test server desktop and open it
             -open domino admin -> go to peoples->click Create->Agent->Put name(All User export) -Select type: Java-OK

-Open java file and paste  the below code and save it

Close the domino designer

--------------------------------------------------------------------------------------------


import lotus.domino.*;

import java.io.*;
import java.util.Iterator;
import java.util.Vector;
import java.lang.Enum;


public class JavaAgent extends AgentBase {

//no enums in the default java version supported by Domino :(
private class SMTPLocalPartTypeEnum {

static final int SHORTNAME = 2;
static final int FULLNAME = 0;
static final int COMMONNAME = 1;
}

private class AddressBuilder {
private Document _gddDoc;
private String _domainSepChar;
private int _smtpLocalPartType;
private boolean _isValidGDD;



AddressBuilder(Document gddDoc) throws Exception{
_gddDoc = gddDoc;
_domainSepChar = gddDoc.getItemValueString("SMTPNotesDomainSepChar");
_smtpLocalPartType = gddDoc.getItemValueInteger("SMTPLocalPart");

_isValidGDD = true;

if (gddDoc.getItemValueInteger("SMTPNotesDomainIncluded") != 0) {
System.out.println("domain(s) included is not set to none");
_isValidGDD = false;
}

if (gddDoc.getItemValueInteger("SMTPNotesDomainPos") == 1) {
System.out.println("Domains pos is not at left of the @ char");
_isValidGDD = false;
}

}


String buildInternetAddress(String mailDomain, Name name, String shortName) throws Exception {
if (!_isValidGDD)
return "";

String leftPart = "";

switch (_smtpLocalPartType)
{
case SMTPLocalPartTypeEnum.SHORTNAME:
leftPart = shortName;
break;
case SMTPLocalPartTypeEnum.COMMONNAME:
leftPart = name.getCommon().replace(' ', '_');
break;
case SMTPLocalPartTypeEnum.FULLNAME:
leftPart = name.getAbbreviated().replace(' ', '_');
break;

}

String ret = leftPart +_domainSepChar + mailDomain + "@" +
_gddDoc.getItemValueString("LocalPrimaryInternetDomain").toString();

return ret;

}

}

private class AddressBuilderProvider {


AddressBuilder _addressBuilder = null;
boolean _noGDD = false;
JavaAgent _agent;

AddressBuilderProvider(JavaAgent agent) {
_agent = agent;
}

AddressBuilder GetBuilder(String mailDomain) throws Exception
{
//for now ignore mailDomain and return default GDD or the single GDD found
if (_noGDD)
return null;

//based on further testing we may need to load different GDDs into a dictionary based on maildomain
//for now just use default gdd in case there are more than one or gdd found.
if (_addressBuilder != null)
return _addressBuilder;

View domains = _agent.getSession().getCurrentDatabase().getView("$Domains");


Document doc = domains.getFirstDocument();

if (doc == null)
System.out.println("first doc in dominas is null");


Document gdd = null;
while (doc != null)
{
System.out.println(doc.getItemValueString("DomainType").toString());
if (doc.getItemValueString("DomainType").toString().trim().compareTo("GlobalDomain") == 0)
{

gdd = doc;
if (doc.getItemValueInteger("DefaultGlobalDomain") == 1)
break;
}
doc = domains.getNextDocument(doc);
}

if (gdd == null)
{
System.out.println("gdd not found");
_noGDD = true;
return null;
}

_addressBuilder = new AddressBuilder(gdd);

return _addressBuilder;


}


}

private AddressBuilderProvider _addressBuilderProvider;

    public void NotesMain() {

    FileWriter fw = null;
      try {
   
     System.out.println("Starting...");
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
          Database db = session.getCurrentDatabase();
          _addressBuilderProvider = new AddressBuilderProvider(this);
       
          View view = db.getView("$VIMPeople");
          view.setAutoUpdate(false);
          Document doc = view.getFirstDocument();
       
          File file = new File("AllUserexport.txt");
          if (file.exists())
         file.delete();
          file.createNewFile();
          fw = new FileWriter(file);
       
          String lineSeparator = (String) java.security.AccessController.doPrivileged(
                  new sun.security.action.GetPropertyAction("line.separator"));
       
          fw.append(lineSeparator);    
          fw.append(lineSeparator);
          fw.append(lineSeparator);
       
       
          while (doc != null)
          {
       
         Item fullName = doc.getFirstItem("FullName");        
         String dn = fullName.getValues().get(0).toString();
         System.out.println(dn);
         String shortName = doc.getItemValueString("ShortName").toLowerCase();
         Name name = session.createName(dn);
         fw.append("dn: ");
         fw.append(dn);
         fw.append(lineSeparator);
       
         Item givenName = doc.getFirstItem("FirstName");
         //if (givenName.getText().length() > 0)
         //{
         fw.append("FirstName: ");
         fw.append(givenName.getText());
         fw.append(lineSeparator);
         //}
       
        //  'MiddleInitial
       
         Item MiddleInitial = doc.getFirstItem("MiddleInitial");
             fw.append("MiddleInitial: ");
             fw.append(MiddleInitial.getText());
             fw.append(lineSeparator);
           
           
           
        Item lastName = doc.getFirstItem("LastName");
         fw.append("LastName: ");
         fw.append(lastName.getText());
         fw.append(lineSeparator);
       
        Item mailFile = doc.getFirstItem("MailFile");
           fw.append("MailFile: ");
           fw.append(mailFile.getText());
           fw.append(lineSeparator);
       
       
         Item mail = doc.getFirstItem("InternetAddress");
         System.out.println("mail:" + mail.getText() + " length:" + mail.getText().length());
         String internetAddress = mail.getText().trim() == null  || mail.getText().length() == 0 ? buildAutoGenInternetAddress(doc, name, shortName) : mail.getText();
         fw.append("mail: ");
         fw.append(internetAddress);
         fw.append(lineSeparator);
       
         Item mailDomain = doc.getFirstItem("MailDomain");
         String mailDomainStr = mailDomain.getText() == null ? "" : mailDomain.getText();
         fw.append("maildomain: ");
         fw.append(mailDomainStr);
         fw.append(lineSeparator);
       
         String userNames = getUserNamesLeftPartOnly(fullName) ;
      //    userNames = internetAddress == null || internetAddress.isEmpty() ? userNames :
          //userNames + ";" + getEmailAddrLeftPart(internetAddress);
         fw.append("usernames: ");
         fw.append(userNames);
         fw.append(lineSeparator);
       
       
         fw.append(lineSeparator);
       
         doc = view.getNextDocument(doc);
          }
       
          fw.append(lineSeparator);
       
       
          // (Your code goes here)

      } catch(Exception e) {
          e.printStackTrace();
          System.out.println(e.getMessage());
       }
      finally {
     if (fw != null)
try {
fw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
      }
   }
 
    String getUserNamesLeftPartOnly(Item fullName) throws Exception {
    Vector userNames = fullName.getValues();
    StringBuilder sb = new StringBuilder();
    Iterator it = userNames.iterator();
    while (it.hasNext()) {
    String userName = (String)it.next();
    if (userName.indexOf("@")>0)
    sb.append(getEmailAddrLeftPart(userName));
    else
    sb.append(userName.toLowerCase());
    sb.append(";");
    }
    return sb.toString();
    }


    String getEmailAddrLeftPart(String emailAddress) throws Exception {
//int atPos = 0;
//atPos = emailAddress.indexOf("@");
//return emailAddress.substring(0,atPos).toLowerCase();
Name name = getSession().createName(emailAddress);
return name.getAddr822LocalPart().toLowerCase();

    }
 
    String buildAutoGenInternetAddress(Document personDoc, Name name, String shortName) throws Exception
    {
    System.out.println(" in buildAutoGenInternetAddress");
    String mailDomain = personDoc.getItemValueString("MailDomain").toString();
    if (mailDomain == "")
    return "";
   
    AddressBuilder addressBuilder = _addressBuilderProvider.GetBuilder(mailDomain);
    if (addressBuilder == null)
    return "";
   
   
    return addressBuilder.buildInternetAddress(mailDomain, name, shortName);
    }




}


Close the domino designer
------------------------------------------------------------------------------------------------

Export User information

  1.  Open Admin->Click Action->Click on All User export
  2. You will fine the AllUserexport.txt file in Lotus folder at admin client path


Reference: https://archive.atlassian.net/wiki/display/adminhelp/Domino+User+Export+Instructions


Monday, May 27, 2013

Fresh Mango from Rajshahi ,Bangladesh


Fresh Mango from  Rajshahi Bangladesh

We are 100 % fresh mango from Our Mango garden (Rajshahi). Our Mangoes
1.       Langra
2.       Karshapat
3.       GopalBog
4.       Lokna
5.       Fozli
Minimum order quantity is 20 KG. You will pay currier service charges. For any query please mail : info@makeslifestyle.com



VMware EXSI Vs Vcenter

VMware EXSI VS Vcenter


  • VMware ESXi 5 - This i sthe virtualization platform, also called the Hypervisor. This is installed on to a physical machine and virtualize the physical resources - cpu, memory, disk and networ - to be used by the virtual machines. These virtual machines can run either server operating systems used when virtualizing a datacenter or dekstop operting systemm deploying virtual desktops. You can mange an ESXi using the vSpher Client which can be downloaded from the ESXi host by connecting to the host with a web browser.
  • VMware vCenter 5 - This allows you to manage multiple ESXi servers through vSphere client. Like with ESXi server you can download the vSphere client from your vCenter server by pointing a browser at the vCenter server. vCenter also allows you to do the higher order functions if yoou are licensed for the like VMware DRS, VMware HA, VMware FT, vMotion and Storage vMotion to name a few. vCenter can be installed on a physical or virtual machine.
  • VMware View 5 0 - This is VMware's Desktop Virtualization offering. View relies on ESXi to provide the platform for virtualizing the desktops. VIew server works in conjunction with vCenter to manage the desktop environment. It also acts as a broker connecting the end users to their virtual desktops either through the View client or other RDP solution. VMware View can be installed on a physical machine or a virtual machine,

Upload Video/Audio Files to Database and Download using C#

Upload Video/Audio Files to Database and Download using C#


First you have to create a database named "MediaDB" in your SQL Server. Then create a table named "MediaTable" in your newly created database. Now create 4 columns in "MediaTable" as given below-
1. ID (int, not null, IsIndentity: Yes)
2. FileName (text, allow nulls)
3. MediaData (varbinary(MAX), allow nulls)
4. Extension (text, allow nulls)
Then save all.

Now create a new Visual C# type website in your Visual Studio.

Download this Default.aspx to understand what asp controls you have to put in your "Default.aspx" page.

And here is the code of your website's "Default.aspx.cs" page:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
using System.Data.Sql;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Upload_Btn_Click(object sender, EventArgs e)
    {
        String fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
        if (FileUpload1.HasFile)
        {
            try
            {
                SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=MediaDB;Integrated Security=True");
                con.Open();
                byte[] MediaBytes = new byte[FileUpload1.PostedFile.InputStream.Length];
                FileUpload1.PostedFile.InputStream.Read(MediaBytes, 0, MediaBytes.Length);
                string qry = "Insert into MediaTable(FileName, MediaData, Extension) values(@FName, @MediaData, @Ext)";
                SqlCommand cmd = new SqlCommand(qry, con);
                cmd.Parameters.AddWithValue("@FName", FileUpload1.FileName);
                cmd.Parameters.AddWithValue("@MediaData", MediaBytes);
                cmd.Parameters.AddWithValue("@Ext", fileExtension);
                cmd.ExecuteNonQuery();
                con.Close();
                Label1.Text = "Media Uploaded Successfully!";
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
        }
        else
        {
            Label1.Text = "No File is Selected!";
        }

    }
    protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        try
        {
            SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=MediaDB;Integrated Security=True");
            con.Open();
            String ID = (GridView1.DataKeys[e.NewSelectedIndex].Value).ToString();
            String qry = "Select * From MediaTable Where(ID=" + ID + ")";
            SqlCommand cmd = new SqlCommand(qry, con);

            SqlDataReader reader = cmd.ExecuteReader();
            reader.Read();

            string filename = (String)reader.GetValue(1);
            byte[] fileToDownload = (byte[])reader.GetValue(2);
            String fileExtension = (String)reader.GetValue(3);

            //Add the file name and attachment, which will force the open/cancel/save dialog to show, to the header

            Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
            Response.ContentType = fileExtension;
            Response.AddHeader("Content-Length", fileToDownload.Length.ToString());

            Response.BinaryWrite(fileToDownload);
            Response.Flush();
            Response.End();


        }
        catch (System.Exception exp)
        {
            Label1.Text = (exp.Message);
        }

    }
}

Reference monojindia.brinkster.net