Mga Archive ng kategorya: BDC

Quick Tip: BDC ADF Bersyon Numero Sigurado Ang iyong Kaibigan

Kung ikaw ay hand-coding file ADF at paggawa ng maraming code / import / test cycle, use the version number to make your life easier.

Galit kong umamin ito, pero hanggang sa linggong ito, I was always deleting the ADF and re-importing it. This would break my business data columns and make me re-wire them. All unnecessary.

File this under "it’s obvious once you see it".

Halimbawa:

<LobSystem
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Uri="WebService" Salin="1.2.0.0" Pangalan="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Baguhin ang bersyon na iyon at muling pag-import at ang umiiral na hanay ng negosyo ay gumagamit ng data sa na-update na bersyon awtomatikong na walang karagdagang configuration na kinakailangan.

</dulo>

Mag-subscribe sa aking blog.

Technorati Tags:

Solusyon: BDC Picker Ipinapakita lamang One Haligi Ng Mga Resulta

Sa aking on-pagpunta pagtatangka sa pagbibigay ng higit pang mga kapaki-pakinabang na lookup gamit ang haligi BDC, I hit a wall with the BDC picker. If you haven’t see it, the BDC picker is similar to a people picker except that it works with columns of type "business data".

Mong ma-access ang picker sa pamamagitan ng pag-click sa icon na open book ng isang hanay ng data ng negosyo tulad ng ipinapakita:

imahen

The above image shows a business data column called "Master Document Id". That column is connected, sa pamamagitan ng BDC, to a web service. The web service returns two columns of information: Document ID and Title. The business purpose here is to provide a "this document is based on" tungkulin. Users select a "master" dokumento at kapag sila ay i-save ang, isang kaganapan receiver kopya meta data mula sa mga patlang ang reference master.

Sa pamamagitan ng default, the BDC picker looks like this when I search for a document whose ID = "38":

clip_image002

Iyon ay kapaki-pakinabang, but not good enough. People don’t think in terms of IDs, they think in terms of titles and/or other meta data. The picker allows you to search on other columns (e.g. Pamagat) ngunit hindi ipapakita ang aktwal na listahan ng mga pamagat na ito natagpuan, lamang DocId kanilang ay tulad ng ipinapakita dito:

clip_image002[1]

(Ang screen shot ay hindi kaya mahusay na ito dahil hindi ko na lang ng paghahanap na nagbabalik ng anumang wastong mga resulta, ngunit maaari mong makita na kung ito ay natagpuan ng ilang mga resulta, Gusto ito lamang ang nagpakita sa DocId ni, Hindi pamagat).

I searched high and low for the answer to this and failed. Ang aking kasamahan, ang mga karapat-dapat sambahin Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, siya tulis sa akin sa tamang direksyon.

Configure the picker to show multiple columns via the "ShowInPicker" ari-arian sa ADF:

<Ari-arian Pangalan="ShowInPicker" Uri="System.Boolean">totoo</Ari-arian>

Sa higit pang mga detalye:

  <!-- Pamagat -->
  <TypeDescriptor TypeName="System.String" Pangalan="Pamagat" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Pamagat</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Katangian>
      <Ari-arian Pangalan="DisplayByDefault" Uri="System.Boolean">totoo</Ari-arian>
      <Ari-arian Pangalan="ShowInPicker" Uri="System.Boolean">totoo</Ari-arian>
    </Katangian>
  </TypeDescriptor>

Setting this property does introduce a minor problem. As soon as you set it once, you need to set it for every column you want to show. Sa aking kaso, BDC picker showed DocId by default. Gayunman, once I added "ShowInPicker" sa Pamagat, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Narito ang resulta ng:

imahen

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, ito ay isang concatenated string na nagbibigay-daan para sa isang bahagyang mas mahusay na karanasan ng gumagamit).

Talaga, pagkakaroon ng nakasulat na ito blog entry, I just did a search for "ShowInPicker" at nakitang maraming mga hit, kabilang ang isang ito: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</dulo>

Mag-subscribe sa aking blog!

Technorati Tags:

Solusyon sa BDC Pagkabigo ADF-import: “Ang mga sumusunod na error na naganap:”

Ako ay isang beses muli crafting BDC ADF mga file sa pamamagitan ng kamay (so that I can build up my "get off my lawn!" cred) at pindutin ang kaibig-ibig na error:

imahen

"Application definition import failed. Ang mga sumusunod na error na naganap:"

Tulad ng iyong nakikita, mayroong isang error, pero … ito ay hindi pagpunta sa sabihin sa akin kung ano ito ay.

Sa aking kaso, the issue turned out that I had started off with a functional ADF for a different project that connected to a database and executed a SQL query against a view. In this new project, I am calling a method on a web service. I had stripped out the DB specific stuff and added my web service stuff, but failed to update the <LobSystem>’s Type attribute. I switched it to "WebService" and I happily moved on to newer and more exciting import errors, which were handled in due course.

Here is the wrong LobSystem:

<LobSystem
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalogBDCMetadata.xsd
Type="Database"
Version="1.0.0.0" Name="xyzzy"
xmlns="
http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

This is correct:

<LobSystem
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalogBDCMetadata.xsd
Type="WebService"
Version="1.0.0.0" Name="xyzzy"
xmlns="
http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

</dulo>

Technorati Tags:

BDC tila isang praktikal Kapalit Para lookup

I-UPDATE: Ito MSDN pag-post ay may ilang mga kagiliw-giliw na mga obserbasyon mula JXJ batay sa kanyang, higit sa lahat ng mga negatibong, mga karanasan lapag ng path na ito: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2623565&SiteID=1

We have a business scenario where we need to link two documents libraries via a common "document ID" patlang.

We often use a lookup column to implements links like this. There are several drawbacks to lookup columns, tatlong ng na kung saan ay:

  1. Only one column from the lookup lookup library can be linked.
  2. Pagganap: The source library could contain hundreds of entries. That’s too many entries in the lookup.
  3. Hanapin: There is no integrated search. I don’t mean in the MOSS sense of search, ngunit walang paraan upang maghanap / i-filter sa maramihang mga hanay mula sa library ng pinagmulan ng dokumento at hanapin ang link na gusto mo.

Nai-back sa pamamagitan ng BDC, we can use a "business data" column type and it provides a superior search and even allows multiple columns of data to appear in list views.

Nagkaroon na ako ng ilang paunang tagumpay gamit ang diskarteng ito at plano upang isulat ang higit pa tungkol dito.

Kung nag-nagtrabaho anggulo ito bago at mayroon ng anumang mga komento, mangyaring ibahagi!

</dulo>

Technorati Tags:

Solusyon sa BDC Import Error: “Hindi ma-load Uri ng inilarawan sa pamamagitan ng TypeDescriptor ni TypeName …”

Ako nagtatrabaho sa BDC ngayon, coding ADF files by hand and generating myself some errors. One such error:

Application kahulugan Nabigo ang pag-import. Ang mga sumusunod na error na naganap: Hindi ma-load Uri ng inilarawan sa pamamagitan ng TypeDescriptor ni TypeName. Pangalan ng parameter: typeName Error naranasang sa o bago lang Linya: '35’ at Posisyon: ’20’.

Moss ipinapakita ang error na ito kapag sinubukan kong i-import ang file na XML ADF.

Sinaliksik ko ang Internets at nalaman na ako ay tumutukoy sa mga pangalan palobo halimbawa (mula sa <LobSystemInstance>) sa aking <TypeDescriptor> node kailan ko dapat na-reference ang palobo pangalan mismo (mula sa <LobSystem>).

Mali:

<TypeDescriptor TypeName="Conchango.KeyValue, Palobo Halimbawa Pangalan" Name="KeyValue">

Itama:

<TypeDescriptor TypeName="Conchango.KeyValue, Palobo Pangalan" Name="KeyValue">

Sana isa ito sine-save ng isang tao ng isang oras o dalawang oras ng.

</dulo>

Mag-subscribe sa aking blog!

Technorati Tags:

Isang BDC runtime error ipinaliwanag

Ako sanhi ng BDC error sa linggong ito na ipinahayag sa sarili nito sa user interface at sa mga 12 hive log at runtime.

Una, ito ay lumitaw sa interface ng gumagamit:

Hindi makahanap ng mga patlang upang ipasok ang lahat ng mga Halaga ng Tagatukoy upang tamang magsagawa ng isang SpecificFinder MethodInstance sa Pangalan … Ensure input Parameters have TypeDescriptors associated with every Identifier defined for this Entity.

Narito ang isang screen shot:

clip_image001

I could also cause this message to appear in the 12 hive log at will (using my patented high-tech-don’t-try-this-at-home "mysterious errors" pamamaraan):

11/14/2007 09:24:41.27 w3wp.exe (0x080C) 0x0B8C SharePoint Portal Server Business Data 6q4x High Exception in BusinessDataWebPart.OnPreRender: System.InvalidOperationException: The Identifier value ”, of Type ”, is invalid. Expected Identifier value of Type ‘System.String’. at Microsoft.Office.Server.ApplicationRegistry.MetadataModel.Entity.FindSpecific(Object[] subIdentifierValues, LobSystemInstance lobSystemInstance) at Microsoft.SharePoint.Portal.WebControls.BdcClientUtil.FindEntity(Entity entity, Object[] userValues, LobSystemInstance lobSystemInstance) at Microsoft.SharePoint.Portal.WebControls.BusinessDataItemBuilder.GetEntityInstance(View desiredView) at Microsoft.SharePoint.Portal.WebControls.BusinessDataDetailsWebPart.GetEntityInstance() at Microsoft.SharePoint.Portal.WebControls.BusinessDataDetailsWebPart.SetDataSourceProperties()

I searched around and found some leads in the MSDN forum, but they weren’t enough for me to understand what I was doing wrong. I watched a webcast by Ted Pattison that my company has squirreled away on a server and came to realize my problem.

In my ADF, I’m connecting to a SQL database as shown:

            <Ari-arian Pangalan="RdbCommandText" Uri="System.String">
              <![CDATA[
                SELECT
                      SETID, CARRIER_ID, EFFDT, DESCR, EFF_STATUS, TAXPAYER_ID, NETWORK_ID, FRT_FORWARD_FLG, ALT_NAME1, ALT_NAME2, LANGUAGE_CD,
                      COUNTRY, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, CITY, NUM1, NUM2, HOUSE_TYPE, ADDR_FIELD1, ADDR_FIELD2, ADDR_FIELD3,
                      COUNTY, STATE, POSTAL, GEO_CODE, IN_CITY_LIMIT, COUNTRY_CODE, PHONE, EXTENSION, FAX, LAST_EXP_CHK_DTTM, FREIGHT_VENDOR,
                      INTERLINK_DLL, TMS_EXCLUDE_FLG
                FROM
                      dbo.PS_CARRIER_ID_VW WITH (nolock)
                WHERE
                  (SETID <> 'SHARE') at
                  (lower(CARRIER_ID) >= lower(@MinId)) at
                  (lower(CARRIER_ID) <= lower(@ MaxId)) at
                  (lower(DESCR) LIKE lower(@InputDescr))
                ]]>
            </Ari-arian>

I was provided that SQL from a DBA person and I’m given to understand that it’s a espesyal view they created just for me. The unique key there is CARRIER_ID.

Here is the bug I introduced:

      <Identifiers>
        <Identifier Pangalan="CARRIER_ID" TypeName="System.String" />
        <Identifier Pangalan="DESCR" TypeName="System.String" /> 
</Identifiers>

Sa isang lugar sa kahabaan ng linya, I had managed to confuse myself over the meaning of <Identifiers> and added DESCR even though it’s not actually an identifier. I took DESCR out of the identifiers set and presto! It all worked.

I hope this saves someone some grief 🙂

Technorati Tags: , , ,

BDC ADF at ang iyong mga kaibigan, CDATA

Napansin ko ang ilang mga hindi akma at hindi kailangan hand-encode ng RdbCommandText sa ilang mga halimbawa (kabilang ang MSDN dokumentasyon).

I wanted to point out to newcomers to BDC that commands can be wrapped inside a CDATA tag in their "natural" form. Kaya, ito nakahihiya konstruksiyon:

<Ari-arian Pangalan="RdbCommandText" Uri="System.String">
Piliin dbo.MCRS_SETTLEMENT.id, dbo.MCRS_SETTLEMENT.settlement mula dbo.MCRS_SETTLEMENT
WHERE (ID &gt;= @MinId) AT (ID &lt;= @ MaxId)
</Ari-arian>

Maaaring mas mahusay na kinakatawan sa ganitong paraan:

<Ari-arian Pangalan="RdbCommandText" Uri="System.String">
<![CDATA[
Piliin dbo.MCRS_SETTLEMENT.id, dbo.MCRS_SETTLEMENT.settlement mula dbo.MCRS_SETTLEMENT
WHERE (ID >= @MinId) AT (ID <= @ MaxId)
]]>
</Ari-arian>

</dulo>

BDC aklat ng baguhan

Intro sa BDC

Halimbawa functional: BDC ADF na nag-uugnay sa SQL database na may naka-embed na user id at password

I needed to wire up MOSS to a SQL database via BDC. For testing/POC purposes, I wanted to embed the SQL account user id and password in the ADF. Starting with ang template na ito (http://msdn2.microsoft.com/en-us/library/ms564221.aspx), Nilikha ko ang isang ADF na nag-uugnay sa isang partikular na halimbawa SQL server at mga log in gamit ang isang tiyak na user id at password at ipinakita ang snippet na ito:

  <LobSystemInstances>
    <LobSystemInstance Pangalan="ClaimsInstance">
      <Katangian>
        <Ari-arian Pangalan="AuthenticationMode" Uri="System.String">Ipinasang</Ari-arian>
        <Ari-arian Pangalan="DatabaseAccessProvider" Uri="System.String">SqlServer</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Pinagmulan ng Data" Uri="System.String">aktwal na server  aktwal na halimbawa</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Paunang Catalog" Uri="System.String">aktwal na paunang catalog</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Integrated Security" Uri="System.String">SSPI</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Pooling" Uri="System.String">hindi totoo</Ari-arian>

        <!-- Ito ang mga mahahalagang halaga: -->
        <Ari-arian Pangalan="RdbConnection User ID" Uri="System.String">isangctual User ID</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Password" Uri="System.String">aktwal Password</Ari-arian>
        <Ari-arian Pangalan="RdbConnection Trusted_Connection" Uri="System.String">hindi totoo</Ari-arian>

      </Katangian>
    </LobSystemInstance>
  </LobSystemInstances>

Ito ay hindi isang pinakamahusay na kasanayan, but it’s useful for a quick and simple configuration for testing. This was surprisingly difficult to figure out. I never found a functional example with search keywords:

  • adf naka-embed na userid at password
  • i-embed ang user id at password sa adf
  • i-embed ang user id at password sa adf bdc
  • sharepoint bdc aklat ng baguhan
  • sharepoint embed user id at password sa adf

</dulo>

Mag-subscribe sa aking blog.