Moss / InfoPath Forms Server (InfoPath 2007) goitibeherako zerrendan performance

Kategoria osagarriak: InfoPath

Laburpena: InfoPath bat 2007 osatzeko MOSS zerbitzari bat zabaldu saltzaileen zerrenda goitibeherako pertsonalizatu baten MOSS lotuta zerrenda bat eskaintzen du. Saltzaile bat hautatu gainean, arau esleitzeko eremuan balioak testu, hala nola, salmenta FONDOA izena arlo eskukada bat, helbidea, hiria, egoera, zip eta telefono. Performance da izugarria. Errendimendua lortzen okerragoa nabarituko dugu (ez-lineala moda batean) gehigarri bakoitzeko eremuan modu hau eguneratu dugu. Hau da,, besterik ez dugu, bada, eguneratu salmenta FONDOA izena, hartzen [x] zenbat denbora. Eguneratu dugu salmenta FONDOA bada, address1, address2, hiria, egoera, zip, hartzen 10 aldiz gehiago.

Irtenbidea: Idatzi web zerbitzu bat (lagin-kodea aurki daitezke hemen) hori saltzaile baten izena igaro eta atzera itzultzen du saltzaileak xehetasunak. Gero, esleitzeko eremu Modu honetan. Hori ere, badirudi, nahiz eta geldoa, ez zen errendimendu diferentzia discernable ez dugunean esleitutako 1 Eremu versus 8 eremu. Bat gehitu bonus gisa, users get a cool "contacting the server" Cylon Efektu inprimakia bitartean itxaron eta deitu kontsumitzen zerbitzu emaitzak.

Moss: Salbuespena gertatu da. (HRESULT from Exception: 0x80020009 (DISP_E_EXCEPTION))

UPDATE: Zehazten ez dugu arazo honen arrazoia erro eta Azalera inoiz berriro.

Nabarituko garapen gune bat-batean hori ezartzeko zehar, Bi erabiltzaileak ez dira gune bilduma bat sartzeko. Kontu horiek ahal nagusira gune autentifikatu, baina jakin batean gune bilduma atzitzean, lortzeko besterik ez dute pantaila bat. Akatsik ez bistaratuko, zuri bat besterik ez da orri zuri.

Saioa bat gune bilduma admin jo dugu, eta saiatu erabiltzaile horietako bat gehitzeko admin gune gisa, eta denbora honetan, upon pressing "OK", Mezu hau lortuko dugu:

Salbuespena gertatu da. (HRESULT from Exception: 0x80020009 (DISP_E_EXCEPTION))

Denbora pixka bat igaro dugu hau eta, zoritxarrez, ikertzen, ez ziren etorri ezer erabilgarria. Baziren diagnostiko log mezuak batzuk, baina gogorra izan zen, zehazki, horiek erlazionatzeko gai horri.

Azkenean, ezabatzen gune bildumaren dugu, eta berriro sortu da, eta hori konpondu.

Irudikatu dut, bada, zer eragin hau etorkizunean, Post hau eguneratuko dut.

Moss: Zerrendak pertsonalizatu bidez, eta errepikatzean iragazi datuak itzuli InfoPath

Mailako eszenatokia:

Provide a method that enables users to enter accurate purchase requisitions quickly.

Mailako arazoa:

The client does business with several hundred vendors.

Vendors are "type" specific. This means that a vendor sells computer equipment (e.g. Dell) or office supplies (e.g. Staples).

How do we enable end users who create purchase requisitions select a valid vendor?

Mailako irtenbidea:

Differentiate vendors in the system via "type".

Enable users to select the "type" of product and then provide a filtered set of appropriate vendors.

Irtenbide teknikoa:

An InfoPath form has been designed that enables users to enter online purchase requisitions.

Two InfoPath selection lists control vendor selection. Lehen, the user selects a "purchase type". This limits a second selection list to contain only vendors that sell for that purchase type. This is a classic cascading drop-down.

Vendors are stored in a MOSS custom list with custom columns for vendor attributes such as name, address and especially "type".

Implement a web service for an InfoPath client to consume that iterates through the custom vendor list, returning only vendors matching a supplied "type".

Invoke the web service via the InfoPath form.

Ikasitakoa:

  • Lehen, it seems necessary to go this route. I would have preferred to do the filtering entirely within InfoPath and not create any web service functionality here. Hala eta guztiz ere, forms server does not provide the required filtering capability. We can put a rule onto a the "type" selection list in the form to sort of re-open the vendor query, but we can’t get it to work properly. Hori dela eta, it was necessary to implement the web service.
  • This is a classic "cascading selection list" problem in the InfoPath forms server world and there are many good examples out there that explain how to solve this.
  • A blank value for a column in the vendor list does not return an empty string when referenced like this: initItem["Vendor Name"]. Horren ordez, it returns a null.

Some other Notes:

  • I return an array[] of vendors because I had some difficulty returning an ArrayList. InfoPath was complaining about it and I didn’t have the time or the inclination to fight over it. Hau, jakina, puts an artificial limit on the total number of vendors. It also compelled me to implement a trim() method on the array because I hate the idea of returning back 100’s of null vendors. InfoPath doesn’t care, but it nagged at me. (Berriz, this was easier than fighting InfoPath over ArrayLists).
  • I implemented a GetSpecificVendorByName() function as well, which may be instructive.

Kodea:

erabiliz Sistema;
erabiliz System.Web;
erabiliz System.Web.Services;
erabiliz System.Web.Services.Protocols;
erabiliz Microsoft.SharePoint;
erabiliz System.Configuration;

/// <laburpena>
///
Vendor Service: Provides vendor related services which today are consumed by an infopath client form.
///
/// History:
/// ——–
/// 07/24/07: Initial coding, Paul J. Gavin of Conchango.
///
/// </laburpena>
[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
publikoak klasean VendorService : System.Web.Services.WebService
{

/// <laburpena>
/// Represents a vendor from a custom sharepoint list maintained by MSUSA.
/// </laburpena>
publikoak klasean Vendor
{
publikoak Vendor() { }

publikoak Vendor(Txu initItem)
{
bada (! (initItem["Vendor Name"] == zero)) VendorName = initItem["Vendor Name"].ToString();
bada (! (initItem["Address 1"] == zero)) VendorAddress1 = initItem["Address 1"].ToString();
bada (! (initItem["Address 2"] == zero)) VendorAddress2 = initItem["Address 2"].ToString();
bada (! (initItem["City"] == zero)) VendorCity = initItem["City"].ToString();
bada (! (initItem["VendorPhone"] == zero)) VendorPhone = initItem["VendorPhone"].ToString();
bada (! (initItem["PurchaseType"] == zero)) VendorType = initItem["PurchaseType"].ToString();
bada (! (initItem["State"] == zero)) VendorState = initItem["State"].ToString();
bada (! (initItem["Zip"] == zero)) VendorZip = initItem["Zip"].ToString();
bada (!(initItem["Fax"] == zero)) VendorFax = initItem["Fax"].ToString();
bada (!(initItem["SalesRepName"] == zero)) VendorSalesRepName = initItem["SalesRepName"].ToString();

VendorItemId = initItem.ID; // Unique ID maintained via MOSS.
}

publikoak int VendorItemId;
publikoak katea VendorName;
publikoak katea VendorAddress1;
publikoak katea VendorAddress2;
publikoak katea VendorCity;
publikoak katea VendorState;
publikoak katea VendorZip;
publikoak katea VendorPhone;
publikoak katea VendorType;
publikoak katea VendorSalesRepName;
publikoak katea VendorFax;
}

publikoak VendorService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

pribatua Vendor[] GenerateTestVendors()
{
Vendor[] resultList;
resultList = berria Vendor[100];

Vendor v;
v = berria Vendor();
v.VendorAddress1 = "v1_address1";
v.VendorAddress2 = "v1_address2";
v.VendorCity = "v1_city";
v.VendorName = "v1_vendorname";
v.VendorPhone = "v1_vendorphone";
v.VendorState = "v1_st";
v.VendorType = "v1_type";
v.VendorZip = "v1_zip";

resultList[0] = v;

v = berria Vendor();

v.VendorAddress1 = "v2_address1";
v.VendorAddress2 = "v2_address2";
v.VendorCity = "v2_city";
v.VendorName = "v2_vendorname";
v.VendorPhone = "v2_vendorphone";
v.VendorState = "v2_st";
v.VendorType = "v2_type";
v.VendorZip = "v2_zip";

resultList[1] = v;

v = berria Vendor();
v.VendorAddress1 = "v3_address1";
v.VendorAddress2 = "v3_address2";
v.VendorCity = "v3_city";
v.VendorName = "v3_vendorname";
v.VendorPhone = "v3_vendorphone";
v.VendorState = "v3_st";
v.VendorType = "v3_type";
v.VendorZip = "v3_zip";

resultList[2] = v;

itzultzeko resultList;

}

[WebMethod]
publikoak Vendor GetSpecificVendorById(int vendorId)
{
katea SpVendorSiteName; // Name of the actual MOSS site that hosts the vendor custom list.
katea SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

erabiliz (SPSite site = berria SPSite(SpVendorSiteName))
{

erabiliz (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

Txu specificItem = currentList.Items[vendorId];

itzultzeko berria Vendor(specificItem);

} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

}

[WebMethod]
// Assumes that the vendor name is unique, from a business perspective
publikoak Vendor GetSpecificVendorByVendorName(katea vendorName)
{
katea SpVendorSiteName; // Name of the actual MOSS site that hosts the vendor custom list.
katea SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

erabiliz (SPSite site = berria SPSite(SpVendorSiteName))
{
erabiliz (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpVendorListName];

foreach (Txu vendorItem urtean currentList.Items)
{
bada (vendorItem["Vendor Name"] == zero) jarraitu;

bada (vendorItem["Vendor Name"].ToString().Berdin(vendorName))
itzultzeko berria Vendor(vendorItem);
}

Vendor v = berria Vendor();
v.VendorPhone = "not found: " + vendorName;

itzultzeko v;

itzultzeko zero;

} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

} // metodoa

[WebMethod]
publikoak Vendor[] GetVendorsOfType (katea filterType)
{

katea SpVendorSiteName; // Name of the actual MOSS site that hosts t
he vendor custom list.
katea SpVendorListName; // Name of the actual MOSS list containing vendors.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

Vendor[] resultList;
int vendorIndex = 0;
resultList = berria Vendor[1000];

// Initialize the list with a default friendly message.
Vendor v = berria Vendor();
v.VendorName = "Select a vendor type to populate this list.";
resultList[0] = v;

// Convert the filter to lower case for easier string comparison later.
filterType = filterType.ToLower();

// If the filter type passed is "test", generate some simple data.
#eskualde Filter type = "test"
bada (filterType.Equals("test"))
itzultzeko GenerateTestVendors();
#endregion

bada (Egia)
{
erabiliz (SPSite site = berria SPSite(SpVendorSiteName))
{
erabiliz (SPWeb web = site.OpenWeb())
{

v = zero;

SPList currentList = web.Lists[SpVendorListName];

// Iterate through all the items in the vendor list.
foreach (Txu vendorItem urtean currentList.Items)
{

katea lowerVendorType;

lowerVendorType = vendorItem["PurchaseType"].ToString().ToLower();
lowerVendorType = lowerVendorType.Substring(3);

bada (lowerVendorType.Equals(filterType))
{
resultList[vendorIndex ] = berria Vendor(vendorItem);
}
} // iterating thru all the vendors in the list


itzultzeko TrimVendorArray(vendorIndex, resultList);
// return resultList;

} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

} // if true

itzultzeko zero;
}

pribatua Vendor[] TrimVendorArray(int newsize, Vendor[] originalVendorArray)
{
Vendor[] trimmedArray;

bada (newsize == 0) newsize = 1;
trimmedArray = berria Vendor[newsize];

int currentCounter = 0;

for (currentCounter = 0; currentCounter < newsize; currentCounter )
{
trimmedArray[currentCounter] = originalVendorArray[currentCounter];
}

itzultzeko trimmedArray;

}
}

Moss: On InfoPath arazketa Oharrak

InfoPath inprimaki zerbitzariak errore mezuak engainagarria.

InfoPath inprimaki baten garapenean zehar, It bidaltzeko nuke MOSS zerbitzaria eta inprimaki sartzeko. Forma eta kargatu ondoren, sortzen engainagarria error message me Windows gertaera log seinalatuz xehetasunak hasteko litzateke. Izan ere,, no message was written to the windows event log. Rather, the message was sent to the MOSS ascii diagnostic log. You can track that down via central services administration.

You need to be quick on your feet. MOSS likes to write to the log file, frequently and verbosely. This can be trimmed but the default log writing behavior is "everything as quickly as possible".

Moss: Zerrenda pertsonalizatu bat eguneratzeko

Asko dira pertsonalizatuak zerrendak eguneratzeko SDK bidez adibide onak. Hemen da beste.

Mailako arazoa: InfoPath forma diseinatu da, horri esker, erabiltzaileek online erosteko requisitions sartu. PO eskakizunak zenbakiak tradizionala sekuentzia oinarritutako balio osokoa izan behar du eta automatikoki kalkulatzen.

Mailako irtenbidea: Sortu zerrenda pertsonalizatuak MOSS bi zutabe dituen: "ControlField" and "ControlValue". Balioen zutabean hurrengo erosketa eskakizunak kopurua baino. Note that the generic "control" konbentzio izendatzen kontrol etorkizuneko eremu hori erabili ahal izango dira, behar bezala eskaintzen.

Irtenbide teknikoa: Sortu InfoPath bezeroak sartu web zerbitzu bat. Web-zerbitzua ematen du atzera hurrengo erosketa eskakizunak kopurua eta eguneratzeak zerrenda balioa.

Ikasitakoa:

  • Noiz web zerbitzu hau gehituz datu-iturburu bat bezala InfoPath inprimakia, Beharrezkoa da bihurtzeko CDU bat eta gorde datu konexioa liburutegian sartu aurkitu dut.
  • Ere aurkitu dut gurutze domeinu scripting beharrezkoa gaitzeko zerbitzu zentralak administrazio bidez // Aplikazio kudeaketa // inprimaki zerbitzari konfigurazio.
  • Lehen aldiz, forma saiatu web zerbitzura sartzeko, berriz, bat egiten da, eta behin, denbora litzateke. Fiddled inprimaki zerbitzari konfigurazio dut denbora muga ezarpenak zabaltzeko eta zirudien laguntzeko.

Kodea:

erabiliz Sistema;
erabiliz System.Web;
erabiliz System.Web.Services;
erabiliz System.Web.Services.Protocols;
erabiliz Microsoft.SharePoint;
erabiliz System.Configuration;

[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
publikoak klasean PoService : System.Web.Services.WebService
{
publikoak PoService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

/// <laburpena>
/// Obtain the next PO number from the sharepoint po number control list.
/// Increment the PO number in that list.
/// </laburpena>
/// <itzultzen></itzultzen>
[WebMethod]
publikoak katea GetNextPoNumber()
{
katea SpPoControlSiteName; // Name of the actual MOSS site that hosts the PO Control list.
katea SpPoControlListName; // Name of the actual MOSS list containing the Po control.

SpPoControlSiteName = ConfigurationSettings.AppSettings["PoControlListHostingSite"].ToString();
SpPoControlListName = ConfigurationSettings.AppSettings["PoControlList"].ToString();

katea nextPoReqNumber = "xyzzy";

erabiliz (SPSite site = berria SPSite(SpPoControlSiteName))
{
erabiliz (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpPoControlListName];

foreach (Txu controlItem urtean currentList.Items)
{

bada (((katea)controlItem["ControlField"]).Berdin("NextPoNumber"))
{
nextPoReqNumber = (katea)controlItem["ControlValue"];

int int_nextPoReqNumber;
int_nextPoReqNumber = Bihurtu.ToInt32(nextPoReqNumber);

int_nextPoReqNumber ;

controlItem["ControlValue"] = int_nextPoReqNumber;
controlItem.Update();
}

} // Locating, reading and updating the PO number in the list.


} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

itzultzeko nextPoReqNumber;

}
}