home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / LinkSrc.cpp < prev    next >
Text File  |  1997-03-21  |  48KB  |  1,085 lines

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: oddataxfer
  5. //
  6. //   CLASSES: none
  7. //
  8. //   ORIGINS: 82,27
  9. //
  10. //
  11. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12. //   All Rights Reserved
  13. //   Licensed Materials - Property of IBM
  14. //   US Government Users Restricted Rights - Use, duplication or
  15. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16. //       
  17. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. //   OR PERFORMANCE OF THIS SOFTWARE.
  24. //
  25. //====END_GENERATED_PROLOG========================================
  26. //
  27. // @(#) 1.6 com/src/storage/LinkSrc.cpp, oddataxfer, od96os2, odos29712d 8/26/96 16:54:06 [ 3/21/97 17:18:55 ]
  28. /*
  29.         File:           LinkSrc.cpp
  30.  
  31.         Contains:       Implementation of ODLinkSource class
  32.  
  33.         Owned by:       Craig Carper
  34.  
  35.         Copyright:      ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  36.  
  37.         Change History (most recent first):
  38.  
  39.                 <41>     10/8/95        TJ              Fixes Recomended by Refball
  40.                 <40>     10/4/95        jpa             Added missing ODVolatiles [1285799]
  41.                 <39>     10/3/95        TJ              Added Includes so it compiles
  42.                 <38>     10/3/95        TJ              Changes done by RefBall Team
  43.                 <37>      9/8/95        Té              1281096 FB2:Many constants in ODTypesB
  44.                                                                         without kOD prefix!
  45.                 <36>      9/1/95        CC              1278590: Added SetStatus(ODError error).
  46.                 <35>     8/12/95        Té              1276807 Opt./Bug: use StdTypIO routines for
  47.                                                                         portable streaming & smaller footprint
  48.                 <34>      8/3/95        RR              #1257260: Collapse B classes. Remove
  49.                                                                         somInit methods. Don't call IsInitialized
  50.                                                                         or SubclassResponsibility
  51.                 <33>     7/28/95        CC              1183569: Externalize only when dirty.
  52.                 <32>     7/20/95        CC              1225443: ShowSourceContent: If the section
  53.                                                                         isn't registered, register temporarily to
  54.                                                                         call GetEditionInfo.
  55.                 <31>     6/12/95        CC              1248090: CloneFromMemoryContainer: Force
  56.                                                                         cloning of frame referenced by
  57.                                                                         kODPropContentFrame property.
  58.                 <30>     5/26/95        VL              1251403: Multithreading naming support.
  59.                 <29>     5/25/95        jpa             Fixed usage of ODDebug. [1253321]
  60.                 <28>     5/18/95        CC              1238898: Add destFrame argument to
  61.                                                                         BeginClone call.
  62.                 <27>     4/27/95        CC              1242555: Removed $5 checkin comment (doh!)
  63.                 <26>     4/14/95        Té              #1235279 BB: InfoUtil & StdTypIO functions
  64.                                                                         should take Environment* and SU* when
  65.                                                                         possible
  66.                 <25>     4/11/95        CC              1236452: Added SOM_CATCH to InitLinkSource
  67.                                                                         and Release.
  68.                 <24>      3/3/95        CC              1210760 SetAutoUpdate: update edition file
  69.                                                                         on change to manual from automatic update.
  70.                                                                         1223861 Added GetStatus(); maintain fStatus
  71.                                                                         field.
  72.                 <23>      2/7/95        CC              1217192: ReadLinkEdition must call
  73.                                                                         somSelf->SetChangeTime AFTER closing the
  74.                                                                         edition file.
  75.                 <22>     1/19/95        CC              1210953 Added override of SetSourcePart.
  76.                                                                         1193561 Code review changes.
  77.                 <21>    12/22/94        CC              1153759 UseLinkEdition - call ODDRaft::
  78.                                                                         SetChangedFromPrev().
  79.                 <20>    12/20/94        VL              1195012: Make Storage calls be
  80.                                                                         marshallable.
  81.                 <19>    12/16/94        CC              1203516 Removed ODLink parameter from
  82.                                                                         InitLinkSource().
  83.                 <18>     12/8/94        CC              1154711 Use ">= kODSharedWrite" to check
  84.                                                                         for write access.
  85.                 <17>    10/10/94        CC              1160355 - Don't register with Edition mgr.
  86.                                                                         if draft is read only.
  87.                 <16>     10/7/94        CC              1191089 - Cross-document updates get new
  88.                                                                         unique ID.
  89.                 <15>     10/4/94        CC              1190862 - Added override of Release().
  90.                 <14>     9/29/94        RA              1189812: Mods for 68K build.
  91.                 <13>     9/23/94        VL              1184272: ContainerID is now a sequence of
  92.                                                                         octets.
  93.                 <12>     9/15/94        CC              1186669 - Implemented CloneInto().
  94.                 <11>      9/7/94        CC              #1185114 - Catch throws from KeyValid().
  95.                 <10>     8/26/94        VL              1183174: Use updated cloning APIs.
  96.                  <9>     8/15/94        Té              #1180922 Removed most obsolete types from
  97.                                                                         StdTypes.idl
  98.                  <8>     8/10/94        CC              1179943 - Moved platform-independent
  99.                                                                         implementation into LinkSrcB.cpp.
  100.                  <7>      8/5/94        CC              #1179160 - ContentUpdated() takes ODLinkKey
  101.                                                                         parameter and sets fContentUpdated instead
  102.                                                                         of updating dependents immediately;
  103.                                                                                 Unlock() updates dependents if contents
  104.                                                                         have changed while locked;
  105.                                                                                 #1153789 (partial implementation) -
  106.                                                                         Clear() iterates over values in contents
  107.                                                                         property and deletes all data;
  108.                  <6>      8/3/94        VL              1153123: Storage to ODStor.
  109.                  <5>     6/24/94        CC              Clean up some easy $5.
  110.                  <4>     6/24/94        CC              Added call to ShowLinkSourceInfo().
  111.                  <3>     6/24/94        CC              Changed parameters to InitBaseLinkSource().
  112.                  <2>     6/21/94        CC              Temporarily remove #include of LinkDlgs.h.
  113.                  <1>     6/21/94        CC              first checked in
  114.  
  115.                 ------------------- CC ---- Converted to SOM
  116.  
  117.                  <6>      5/9/94        MB              #1162181: Changes necessary to install MMM.
  118.                  <5>      4/7/94        CC              SetSourcePart: Allow source part to be nil;
  119.                                                                         Externalize: Remove source part property
  120.                                                                         source part is nil.  (1154858)
  121.                  <4>      4/4/94        CC              CloneFromMemoryContainer: Changed
  122.                                                                         SetValue() to GetValue() to read
  123.                                                                         modification date. (1154449)
  124.                  <3>     3/28/94        CG              1153547: XMPSessn.h renamed to XMPSessM.h
  125.                  <2>     3/27/94        Té              #1153523.  Adjust name of
  126.                                                                         kXMPPropRootPartSU to more clearly indicate
  127.                                                                         what it is supposed to be used for.
  128.                  <1>     3/25/94        CC              first checked in
  129.  
  130.                 ------------------- CC ---- Moved from Core to Storage subsystem
  131.  
  132.                  <5>     3/24/94        CC              Implemented CloneTo() (1153038) and
  133.                                                                         GetChangeTime() (115340); renamed
  134.                                                                         SetAutoExport() and IsAutoExport() to
  135.                                                                         SetAutoUpdate() and IsAutoUpdate()
  136.                                                                         (1142938).
  137.                  <4>     3/14/94        CC              Added SetSourcePart(). (1149440)
  138.                  <3>      3/1/94        JA              Include ODMemory.h (1147588)
  139.                  <2>      3/1/94        CC              Replaced calls to HLock, HUnlock, and
  140.                                                                         GetHandleSize with XMP equivalents.
  141.                  <9>      2/8/94        Té              Throw -> THROW & some code clean up
  142.                  <8>      2/7/94        Té              more fixes to compile with PPC Headers
  143.                  <7>      2/4/94        Té              fixes to compile with PPC Universal headers
  144.                  <6>      2/3/94        CG              System Session break out.
  145.                  <5>      2/1/94        CC              Pass ODCloneKind argument to BeginClone.
  146.                  <4>     1/28/94        CC              Added ReleaseAll(); InitLinkSource does not
  147.                                                                         increment ref count of argument link
  148.                                                                         object.
  149.                  <3>     1/27/94        VL              Used ODStorageUnit::CloneInto.
  150.                  <2>     1/22/94        CC              Don't call release() in destructor.
  151.                  <1>     1/21/94        CC              first checked in
  152.                 <17>     1/18/94        CG              Added include for StorgDef.h
  153.                 <16>     1/18/94        CC              Use kXMPScrapTypePart; release draft
  154.                                                                         properties on failure in
  155.                                                                         CloneToMemoryContainer and
  156.                                                                         CloneFromMemoryContainer
  157.                 <15>     1/14/94        CC              Added Lock(), Unlock(), GetTimeStamp(),
  158.                                                                         GetStatus(), SetAutoExport(),
  159.                                                                         IsAutoExport(), Export(),
  160.                                                                         ShowSourceContent(), type ODLinkKey; added
  161.                                                                         key parameter to various routines; renamed
  162.                                                                         Edition Manager support routines.
  163.                 <14>     1/11/94        Té              Init... changes
  164.                 <13>    12/22/93        CC              Maintain persistent fields fContentSU and
  165.                                                                         fChangedDate.  Read/write link content
  166.                                                                         from/to edition file by cloning fContentSU
  167.                                                                         into a memory container.  Increment link
  168.                                                                         ref count for registered sections.  Write
  169.                                                                         edition files only on Externalize().
  170.                 <12>    12/21/93        VL              Changed ODStorageUnit::GetValueSize to
  171.                                                                         StorageUnit::GetSize.
  172.                 <11>    12/16/93        CC              Added methods to create, write, and read
  173.                                                                         Edition files.  Save Edition Manager
  174.                                                                         section records and aliases persistently.
  175.                 <10>    12/14/93        Té              InitLink changes.  Internalize, Initialize
  176.                                                                         went away.
  177.                  <9>     12/8/93        CC              ODValueLink -> ODPartListLink to avoid
  178.                                                                         name conflict.  Removed multiple
  179.                                                                         constructors.  Added InitPartListLink
  180.                  <8>    11/18/93        Té              call inherited::InitializePersistent()
  181.                                                                         ::Externalize()
  182.                  <7>    11/17/93        CC              RegisterDependent calls the LinkUpdated
  183.                                                                         method of its part argument.
  184.                  <6>     9/29/93        VL              Added InitializePersistent.
  185.                  <5>      7/1/93        NP              Abstract/Concrete breakout.
  186.                  <4>     6/10/93        NP              Added comments.
  187.                  <3>     4/28/93        NP              File name changes.
  188.                  <2>     4/27/93        NP              Now compilable.
  189.                  <1>     4/21/93        NP              first checked in
  190.  
  191.         To Do:
  192.         In Progress:
  193. */
  194.  
  195. #define VARIABLE_MACROS
  196.  
  197. #ifdef _PLATFORM_OS2_
  198.  #ifndef _ITEXT_
  199.  #include <IText.h>
  200.  #endif
  201. #endif
  202.  
  203. #define ODLinkSource_Class_Source
  204. #include <LinkSrc.xih>
  205.  
  206. #ifndef SOM_ODLink_xh
  207. #include <Link.xh>
  208. #endif
  209.  
  210. #ifndef _EXCEPT_
  211. #include <Except.h>
  212. #endif
  213.  
  214. #ifndef _ODMEMORY_
  215. #include <ODMemory.h>
  216. #endif
  217.  
  218. #ifdef _PLATFORM_MACINTOSH_
  219. #ifndef _CONSTDEF_
  220. #include <ConstDef.h>
  221. #endif
  222. #endif
  223.  
  224. #ifndef SOM_ODLinkManager_xh
  225. #include <LinkMgr.xh>
  226. #endif
  227.  
  228. #ifndef SOM_ODPart_xh
  229. #include <Part.xh>
  230. #endif
  231.  
  232. #ifndef SOM_ODSession_xh
  233. #include <ODSessn.xh>
  234. #endif
  235.  
  236. #ifndef SOM_ODContainer_xh
  237. #include <ODCtr.xh>
  238. #endif
  239.  
  240. #ifndef SOM_ODDocument_xh
  241. #include <Document.xh>
  242. #endif
  243.  
  244. #ifndef SOM_ODDraft_xh
  245. #include <Draft.xh>
  246. #endif
  247.  
  248. #ifndef SOM_ODStorageSystem_xh
  249. #include <ODStor.xh>
  250. #endif
  251.  
  252. #ifndef _PLFMFILE_
  253. #include <PlfmFile.h>
  254. #endif
  255.  
  256. #ifndef SOM_ODStorageUnit_xh
  257. #include <StorageU.xh>
  258. #endif
  259.  
  260. #ifndef SOM_Module_OpenDoc_StdProps_defined
  261. #include <StdProps.xh>
  262. #endif
  263.  
  264. #ifndef SOM_Module_OpenDoc_StdTypes_defined
  265. #include <StdTypes.xh>
  266. #endif
  267.  
  268. #ifndef _ISOSTR_
  269. #include <ISOStr.h>
  270. #endif
  271.  
  272. #ifdef _PLATFORM_OS2_
  273. #include <builtin.h>
  274. #else
  275. #ifndef __ERRORS__
  276. #include <Errors.h>
  277. #endif
  278. #endif // _PLATFORM_OS2_
  279.  
  280. #ifndef _ODUTILS_
  281. #include <ODUtils.h>
  282. #endif
  283.  
  284. #ifndef _DOCUTILS_
  285. #include <DocUtils.h>
  286. #endif
  287.  
  288. #ifndef _ODDEBUG_
  289. #include <ODDebug.h>
  290. #endif
  291.  
  292. #ifndef _BARRAY_
  293. #include <BArray.h>
  294. #endif
  295.  
  296. #ifndef _STDTYPIO_
  297. #include <StdTypIO.h>
  298. #endif
  299.  
  300. #ifndef _STORUTIL_
  301. #include <StorUtil.h>
  302. #endif
  303.  
  304. #ifndef _TEMPOBJ_
  305. #include "TempObj.h"
  306. #endif
  307.  
  308. #ifndef _PLATFORM_OS2_
  309. #pragma segment ODLinkSource
  310. #endif
  311.  
  312. //==============================================================================
  313. // ODLinkSource
  314. //==============================================================================
  315.  
  316. //------------------------------------------------------------------------------
  317. // ODLinkSource: somUninit
  318. //------------------------------------------------------------------------------
  319.  
  320. SOM_Scope void  SOMLINK ODLinkSourcesomUninit(ODLinkSource *somSelf)
  321. {
  322.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  323.         ODLinkSourceMethodDebug("ODLinkSource","somUninit");
  324.  
  325.     parent_somUninit(somSelf);
  326. }
  327.  
  328. //------------------------------------------------------------------------------
  329. // ODLinkSource: InitLinkSource
  330. //------------------------------------------------------------------------------
  331.  
  332. SOM_Scope void  SOMLINK ODLinkSourceInitLinkSource(ODLinkSource *somSelf, Environment *ev,
  333.                 ODStorageUnit* storageUnit,
  334.                 ODPart* sourcePart)
  335. {
  336.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  337.         ODLinkSourceMethodDebug("ODLinkSource","InitLinkSource");
  338.  
  339.         #ifdef _PLATFORM_OS2_
  340.         SOM_TRY
  341.         #else
  342.         SOM_CATCH return;
  343.         #endif
  344.  
  345.         /* Moved from somInit. SOM itself sets fields to zero
  346.         _fSection = (SectionHandle) kODNULL;
  347.         _fStatus = 0;
  348.         _fDirty = kODFalse;
  349.         */
  350.         somSelf->InitBaseLinkSource(ev, storageUnit, sourcePart);
  351.  
  352. #ifdef _PLATFORM_OS2_
  353. #else
  354.         somSelf->SetLinkSourceDirty(ev);
  355. #endif
  356.  
  357.         #ifdef _PLATFORM_OS2_
  358.         SOM_CATCH_ALL
  359.         SOM_ENDTRY
  360.         return;
  361.         #endif
  362. }
  363.  
  364. //------------------------------------------------------------------------------
  365. // ODLinkSource: InitLinkSourceFromStorage
  366. //------------------------------------------------------------------------------
  367.  
  368. SOM_Scope void  SOMLINK ODLinkSourceInitLinkSourceFromStorage(ODLinkSource *somSelf, Environment *ev,
  369.                 ODStorageUnit* storageUnit)
  370. {
  371.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  372.         ODLinkSourceMethodDebug("ODLinkSource","InitLinkSourceFromStorage");
  373.  
  374.         #ifdef _PLATFORM_OS2_
  375.         _interrupt(3);
  376.         #else
  377.  
  378.         SOM_CATCH return;
  379.  
  380.         /* Moved from somInit. SOM itself sets fields to zero
  381.         _fSection = (SectionHandle) kODNULL;
  382.         _fStatus = 0;
  383.         _fDirty = kODFalse;
  384.         */
  385.         somSelf->InitBaseLinkSourceFromStorage(ev, storageUnit);
  386.  
  387.         if (ODSUExistsThenFocus(ev, storageUnit, kODPropLinkSection, kODApplesect) )
  388.         {
  389.                 const int sectionRecordSize = sizeof(SectionRecord);
  390.  
  391.                 ODValue value;
  392.  
  393.                 if ( storageUnit->GetSize(ev) != sectionRecordSize )
  394.                         THROW(kODErrCorruptLinkSource);
  395.  
  396.                 _fSection = (SectionHandle) ODNewHandle(sectionRecordSize);
  397.                 value = ODLockHandle((ODHandle) _fSection);
  398.                 StorageUnitGetValue(storageUnit, ev, sectionRecordSize, value);
  399.                 ODUnlockHandle((ODHandle) _fSection);
  400.  
  401.                 if ( (**_fSection).kind != stSubscriber )
  402.                 {
  403.                         ODDisposeHandle((ODHandle) _fSection);
  404.                         _fSection = (SectionHandle) kODNULL;
  405.                         THROW(kODErrCorruptLinkSource);
  406.                 }
  407.  
  408.                 storageUnit->Focus(ev, kODPropEditionAlias, kODPosUndefined, kODApplealis, (ODValueIndex)0, kODPosUndefined);
  409.                 ODULong size = storageUnit->GetSize(ev);
  410.  
  411.                 if ( size < sizeof(AliasRecord) )
  412.                 {
  413.                         ODDisposeHandle((ODHandle) _fSection);
  414.                         _fSection = (SectionHandle) kODNULL;
  415.                         THROW(kODErrCorruptLinkSource);
  416.                 }
  417.  
  418.                 AliasHandle alias = (AliasHandle) ODNewHandle(size);
  419.                 value = ODLockHandle((ODHandle) alias);
  420.                 StorageUnitGetValue(storageUnit, ev, size, value);
  421.                 ODUnlockHandle((ODHandle) alias);
  422.  
  423.                 (**_fSection).alias = alias;
  424.                 (**_fSection).refCon = (long) somSelf;
  425.  
  426.                 ODDraftPermissions permissions = storageUnit->GetDraft(ev)->GetPermissions(ev);
  427.  
  428.                 if (HAS_WRITE_ACCESS(permissions))
  429.                 {
  430.                         ODBoolean aliasWasUpdated;
  431.  
  432.                         ODContainer* container = storageUnit->GetDraft(ev)->GetDocument(ev)->GetContainer(ev);
  433.                         ODFileSpec documentSpec = GetODFileSpecFromContainer(ev, container);
  434.  
  435.                         _fStatus = RegisterSection(&documentSpec, _fSection, &aliasWasUpdated);
  436.  
  437.                         // Remember any error returned by RegisterSection.  The most likely errors are:
  438.                         //      multiplePublisherWrn = -460,            A Publisher is already registered for that container
  439.                         //      containerNotFoundWrn = -461,            Could not find editionContainer at this time
  440.                         //      containerAlreadyOpenWrn = -462,         Container already opened by this section
  441.                         //      notThePublisherWrn = -463,                      Not the first registered publisher for that container
  442.  
  443.                         if ( _fStatus == containerNotFoundWrn )
  444.                                 _fStatus = kODErrCannotFindLinkSourceEdition;
  445.  
  446.                         somSelf->Acquire(ev);   // Link must not be deleted untill its section is unregistered!
  447.                 }
  448.         }
  449.         #endif
  450. }
  451.  
  452. //------------------------------------------------------------------------------
  453. // ODLinkSource: Release (OVERRIDE)
  454. //------------------------------------------------------------------------------
  455.  
  456. SOM_Scope void  SOMLINK ODLinkSourceRelease(ODLinkSource *somSelf, Environment *ev)
  457. {
  458.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  459.         ODLinkSourceMethodDebug("ODLinkSource","Release");
  460.  
  461.         #ifdef _PLATFORM_OS2_
  462.         SOM_TRY
  463.         #else
  464.         SOM_CATCH return;
  465.         #endif
  466.  
  467.         parent_Release(somSelf, ev);
  468.  
  469.         #if ODDebug
  470.         somPrintf("ODLinkSource %d::Release: Ref count is %d\n", somSelf->GetID(ev), somSelf->GetRefCount(ev));
  471.         #endif
  472.  
  473.         if ( somSelf->GetRefCount(ev) == 0 )
  474.                 somSelf->GetStorageUnit(ev)->GetDraft(ev)->ReleaseLinkSource(ev, somSelf);
  475.  
  476.         #ifdef _PLATFORM_OS2_
  477.         SOM_CATCH_ALL
  478.         SOM_ENDTRY
  479.         return;
  480.         #endif
  481. }
  482.  
  483. //------------------------------------------------------------------------------
  484. // ODLinkSource: Externalize (OVERRIDE)
  485. //------------------------------------------------------------------------------
  486.  
  487. SOM_Scope void  SOMLINK ODLinkSourceExternalize(ODLinkSource *somSelf, Environment *ev)
  488. {
  489.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  490.         ODLinkSourceMethodDebug("ODLinkSource","Externalize");
  491.  
  492.         #ifdef _PLATFORM_OS2_
  493.  
  494.         parent_Externalize(somSelf,ev);
  495.  
  496.         #else
  497.         SOM_CATCH return;
  498.  
  499.         parent_Externalize(somSelf,ev);
  500.  
  501.         if ( _fDirty )
  502.         {
  503.                 ODStorageUnit* su = somSelf->GetStorageUnit(ev);
  504.  
  505.                 if ( _fSection == (SectionHandle) kODNULL )
  506.                 {
  507.                         ODSURemoveProperty(ev, su, kODPropLinkSection);
  508.                         ODSURemoveProperty(ev, su, kODPropEditionAlias);
  509.                 }
  510.                 else
  511.                 {
  512.                         SectionPtr theSectionPtr = (SectionPtr) ODLockHandle((ODHandle) _fSection);
  513.  
  514.                         ODSUForceFocus(ev, su, kODPropLinkSection, kODApplesect);
  515.                         StorageUnitSetValue(su, ev, ODGetHandleSize((ODHandle) _fSection), (ODValue) theSectionPtr);
  516.  
  517.                         ODValue theAliasPtr = ODLockHandle((ODHandle) theSectionPtr->alias);
  518.                         ODSUForceFocus(ev, su, kODPropEditionAlias, kODApplealis);
  519.                         StorageUnitSetValue(su, ev, ODGetHandleSize((ODHandle) theSectionPtr->alias), theAliasPtr);
  520.  
  521.                         ODUnlockHandle((ODHandle) theSectionPtr->alias);
  522.                         ODUnlockHandle((ODHandle) _fSection);
  523.                 }
  524.                 _fDirty = kODFalse;
  525.         }
  526.         #endif
  527. }
  528.  
  529. //------------------------------------------------------------------------------
  530. // ODLinkSource: CloneInto (OVERRIDE)
  531. //------------------------------------------------------------------------------
  532.  
  533. SOM_Scope void  SOMLINK ODLinkSourceCloneInto(ODLinkSource *somSelf, Environment *ev,
  534.                 ODDraftKey key,
  535.                 ODStorageUnit* toSU,
  536.                 ODFrame* scopeFrame)
  537. {
  538.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  539.         ODLinkSourceMethodDebug("ODLinkSource","CloneInto");
  540.  
  541.         #ifdef _PLATFORM_OS2_
  542.  
  543.         parent_CloneInto(somSelf, ev, key, toSU, scopeFrame);
  544.  
  545.         #else
  546.  
  547.         SOM_CATCH return;
  548.  
  549.         // If one of our properties already exists, this object has been cloned already
  550.         if ( toSU->Exists(ev, kODPropLinkSection, kODApplesect, 0) )
  551.                 return;
  552.  
  553.         parent_CloneInto(somSelf, ev, key, toSU, scopeFrame);
  554.  
  555.         if ( _fSection != (SectionHandle) kODNULL )
  556.         {
  557.                 ODSUForceFocus(ev, toSU, kODPropLinkSection, kODApplesect);
  558.                 StorageUnitSetValue(toSU, ev, ODGetHandleSize((ODHandle) _fSection), (ODValue) *_fSection);
  559.  
  560.                 ODSUForceFocus(ev, toSU, kODPropEditionAlias, kODApplealis);
  561.                 StorageUnitSetValue(toSU, ev, ODGetHandleSize((ODHandle) (**_fSection).alias), (ODValue) *((**_fSection).alias));
  562.         }
  563.         #endif
  564. }
  565.  
  566. //------------------------------------------------------------------------------
  567. // ODLinkSource: ReleaseAll (OVERRIDE)
  568. //------------------------------------------------------------------------------
  569.  
  570. SOM_Scope void  SOMLINK ODLinkSourceReleaseAll(ODLinkSource *somSelf, Environment *ev)
  571. {
  572.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  573.         ODLinkSourceMethodDebug("ODLinkSource","ReleaseAll");
  574.  
  575.         #ifdef _PLATFORM_OS2_
  576.         SOM_TRY
  577.         #else
  578.         SOM_CATCH return;
  579.         #endif
  580.  
  581.  
  582.         #ifdef _PLATFORM_OS2_
  583.  
  584.         parent_ReleaseAll(somSelf, ev);
  585.  
  586.         #else
  587.         parent_ReleaseAll(somSelf,ev);
  588.  
  589.         if ( _fSection != (SectionHandle) kODNULL )
  590.         {
  591.                 ODDraftPermissions permissions = somSelf->GetStorageUnit(ev)->GetDraft(ev)->GetPermissions(ev);
  592.  
  593.                 if (HAS_WRITE_ACCESS(permissions))
  594.                 {
  595.                         OSErr error = UnRegisterSection(_fSection);
  596.                         somSelf->Release(ev);   // RefCount incremented when section was registered
  597.                 }
  598.  
  599.                 ODDisposeHandle((ODHandle) (**_fSection).alias);
  600.                 ODDisposeHandle((ODHandle) _fSection);
  601.                 _fSection = (SectionHandle) kODNULL;
  602.         }
  603.         #endif
  604.  
  605.         #ifdef _PLATFORM_OS2_
  606.         SOM_CATCH_ALL
  607.         SOM_ENDTRY
  608.         return;
  609.         #endif
  610. }
  611.  
  612. //------------------------------------------------------------------------------
  613. // ODLinkSource: SetAutoUpdate (OVERRIDE)
  614. //------------------------------------------------------------------------------
  615.  
  616. SOM_Scope void  SOMLINK ODLinkSourceSetAutoUpdate(ODLinkSource *somSelf, Environment *ev,
  617.                 ODBoolean automatic)
  618. {
  619.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  620.         ODLinkSourceMethodDebug("ODLinkSource","SetAutoUpdate");
  621.  
  622.         #ifdef _PLATFORM_OS2_
  623.         SOM_TRY
  624.         #else
  625.         SOM_CATCH return;
  626.         #endif
  627.  
  628.         #ifdef _PLATFORM_OS2_
  629.         parent_SetAutoUpdate(somSelf, ev, automatic);
  630.         #else
  631.         parent_SetAutoUpdate(somSelf, ev, automatic);
  632.  
  633.         if ( automatic == kODFalse )
  634.         {
  635.                 ODLinkManager* linkManager = somSelf->GetStorageUnit(ev)->GetSession(ev)->GetLinkManager(ev);
  636.                 ODLink* link = kODNULL;
  637.  
  638.                 TRY
  639.                         link = somSelf->GetLink(ev);
  640.                 CATCH_ALL
  641.                 ENDTRY
  642.  
  643.                 if ( link && linkManager->ExportOnSave(ev, link, kODFalse) )
  644.                 {
  645.                         // The link source was changed from automatic to manual updating,
  646.                         // and the last change was waiting for a save to update the edition file.
  647.                         // Update the edition file now, so cross-document destinations are
  648.                         // consistent with destinations in the same document.  The user will not
  649.                         // be able to manually update the link until another change is made
  650.                         // to the source of the link.
  651.                         ODLinkKey key;
  652.                         if ( link->Lock(ev,0,&key) )
  653.                         {
  654.                                 TRY
  655.                                         link->UpdateLinkEdition(ev, key);
  656.                                 CATCH_ALL
  657.                                 ENDTRY
  658.                                 link->Unlock(ev, key);
  659.                         }
  660.                 }
  661.         }
  662.         #endif
  663.  
  664.         #ifdef _PLATFORM_OS2_
  665.         SOM_CATCH_ALL
  666.         SOM_ENDTRY
  667.         return;
  668.         #endif
  669. }
  670.  
  671. //------------------------------------------------------------------------------
  672. // ODLinkSource: ShowSourceContent (OVERRIDE)
  673. //------------------------------------------------------------------------------
  674.  
  675. SOM_Scope void  SOMLINK ODLinkSourceShowSourceContent(ODLinkSource *somSelf, Environment *ev)
  676. {
  677.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  678.         ODLinkSourceMethodDebug("ODLinkSource","ShowSourceContent");
  679.  
  680. #ifdef _PLATFORM_OS2_
  681.  
  682.    parent_ShowSourceContent(somSelf, ev);
  683.  
  684. #else
  685.  
  686.         SOM_CATCH
  687.         {
  688. #if ODDebug
  689.                 somPrintf("ODLinkSource %d: ShowSourceContent :Error %d caught\n", somSelf->GetID(ev), ErrorCode());
  690. #endif
  691.                 return;
  692.         }
  693.  
  694.         if ( _fSection != (SectionHandle) kODNULL )
  695.         {
  696.                 EditionInfoRecord infoRec;
  697.                 OSErr error;
  698.  
  699.                 if ( IsRegisteredSection(_fSection) == notRegisteredSectionErr )
  700.                 {
  701.                         // Temporarily register to get Editon info
  702.                         // $$$$$ This may cause an section Apple event to arrive
  703.                         ODBoolean aliasWasUpdated;
  704.                         ODContainer* container = somSelf->GetStorageUnit(ev)->GetDraft(ev)->GetDocument(ev)->GetContainer(ev);
  705.                         ODFileSpec documentSpec = GetODFileSpecFromContainer(ev, container);
  706.                         RegisterSection(&documentSpec, _fSection, &aliasWasUpdated);
  707.                         error = GetEditionInfo(_fSection, &infoRec);
  708.                         UnRegisterSection(_fSection);
  709.                 }
  710.                 else
  711.                 {
  712.                         error = GetEditionInfo(_fSection, &infoRec);
  713.                 }
  714.                 if ( error != noErr )
  715.                         THROW(kODErrCannotFindLinkSource);
  716.  
  717.                 error = GoToPublisherSection(&infoRec.container);
  718.                 if ( error == fnfErr )
  719.                         THROW(kODErrCannotFindLinkSourceEdition);
  720.                 else if ( error != noErr )
  721.                         THROW(kODErrCannotFindLinkSource);
  722.         }
  723.         else
  724.         {
  725.         parent_ShowSourceContent(somSelf, ev);
  726.         }
  727. #endif
  728.  
  729. }
  730.  
  731. //------------------------------------------------------------------------------
  732. // ODLinkSource: SetSourcePart (OVERRIDE)
  733. //------------------------------------------------------------------------------
  734.  
  735. SOM_Scope void  SOMLINK ODLinkSourceSetSourcePart(ODLinkSource *somSelf, Environment *ev,
  736.                 ODStorageUnit* sourcePartSU)
  737. {
  738.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  739.         ODLinkSourceMethodDebug("ODLinkSource","SetSourcePart");
  740.  
  741.  
  742.         #ifdef _PLATFORM_OS2_
  743.  
  744.         parent_SetSourcePart(somSelf, ev, sourcePartSU);
  745.  
  746.         #else
  747.         SOM_CATCH return;
  748.  
  749.         ODLinkManager* linkManager = somSelf->GetStorageUnit(ev)->GetSession(ev)->GetLinkManager(ev);
  750.  
  751.         // If there is no source part for this link, delete the edition file when the
  752.         // draft is saved; is there is a source part, make sure the edition file
  753.         // is still maintained.
  754.         linkManager->DeleteOnSave(ev, somSelf->GetLink(ev), (sourcePartSU == kODNULL));
  755.  
  756.         parent_SetSourcePart(somSelf, ev, sourcePartSU);
  757.         #endif
  758. }
  759.  
  760. //------------------------------------------------------------------------------
  761. // ODLinkSource: SetLinkSourceDirty
  762. //------------------------------------------------------------------------------
  763.  
  764. SOM_Scope void  SOMLINK ODLinkSourceSetLinkSourceDirty(ODLinkSource *somSelf, Environment *ev)
  765. {
  766.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  767.         ODLinkSourceMethodDebug("ODLinkSource","SetLinkSourceDirty");
  768.  
  769.         SOM_TRY
  770.                 _fDirty = kODTrue;
  771.  
  772.                 ODDraft* draft = somSelf->GetStorageUnit(ev)->GetDraft(ev);
  773.                 if ( draft->GetPermissions(ev) != kODDPReadOnly )
  774.                         draft->SetChangedFromPrev(ev);
  775.         SOM_CATCH_ALL
  776.         SOM_ENDTRY
  777. }
  778.  
  779. //------------------------------------------------------------------------------
  780. // ODLinkSource: UseLinkEdition
  781. //------------------------------------------------------------------------------
  782.  
  783. SOM_Scope void  SOMLINK ODLinkSourceUseLinkEdition(ODLinkSource *somSelf, Environment *ev,
  784.                 EditionContainerSpec editionContainer,
  785.                 #ifdef _PLATFORM_OS2_
  786.                 FSSpec* documentSpec,
  787.                 #else
  788.                 ODFileSpec* documentSpec,
  789.                 #endif
  790.                 ODULong sectionID,
  791.                 ODLinkKey key)
  792. {
  793.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  794.         ODLinkSourceMethodDebug("ODLinkSource","UseLinkEdition");
  795.  
  796.         #ifdef _PLATFORM_OS2_
  797.         _interrupt(3);
  798.         #else
  799.         SOM_CATCH return;
  800.  
  801.         somSelf->KeyValid(ev, key);
  802.  
  803.         if ( _fSection != (SectionHandle) kODNULL )
  804.                 THROW(kODErrAlreadyImportedLink);
  805.  
  806.         OSErr error = NewSection(&editionContainer, documentSpec, stSubscriber, sectionID, sumAutomatic, &_fSection);
  807.         THROW_IF_ERROR(error);
  808.  
  809.         (**_fSection).refCon = (long) somSelf;
  810.         somSelf->Acquire(ev);   // Link must not be deleted untill its section is unregistered!
  811.  
  812.         somSelf->SetLinkSourceDirty(ev);
  813.         #endif
  814. }
  815.  
  816. //------------------------------------------------------------------------------
  817. // ODLinkSource: ReadLinkEdition
  818. //------------------------------------------------------------------------------
  819.  
  820. SOM_Scope void  SOMLINK ODLinkSourceReadLinkEdition(ODLinkSource *somSelf, Environment *ev,
  821.                 ODLinkKey key)
  822. {
  823.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  824.         ODLinkSourceMethodDebug("ODLinkSource","ReadLinkEdition");
  825.  
  826.         #ifdef _PLATFORM_OS2_
  827.         _interrupt(3);
  828.         #else
  829.         SOM_CATCH return;
  830.  
  831.         somSelf->KeyValid(ev, key);
  832.  
  833.         OSErr                   openError;
  834.         OSErr                   readError = noErr;
  835.         OSErr                   closeError;
  836.         EditionRefNum   edRefNum;
  837.         ODHandle                dataHandle = kODNULL;           ODVolatile(dataHandle);
  838.         long                    dataSize;
  839.         ODBoolean               successful = kODFalse;
  840.  
  841.         if ( _fSection == (SectionHandle) kODNULL )
  842.                 THROW(kODErrNotImportedLink);
  843.  
  844.         openError = OpenEdition(_fSection, &edRefNum);
  845.         if ( openError )
  846.         {
  847.                 _fStatus = openError;
  848.                 THROW(openError);
  849.         }
  850.         else if ( _fStatus == kODErrCannotFindLinkSourceEdition )
  851.         {
  852.                 _fStatus = 0;
  853.         }
  854.  
  855.         readError = EditionHasFormat(edRefNum, kODScrapTypeODBentoContainer, &dataSize);
  856.         if ( readError )
  857.                 _fStatus = readError;
  858.         if ( (readError == noErr) && (dataSize > 0) )
  859.         {
  860.                 TRY
  861.                         dataHandle = ODNewHandle(dataSize);
  862.                         void* dataPtr = ODLockHandle(dataHandle);
  863.                         readError = ReadEdition (edRefNum, kODScrapTypeODBentoContainer, dataPtr, &dataSize);
  864.                         ODUnlockHandle(dataHandle);
  865.                         THROW_IF_ERROR(readError);
  866.  
  867.                         // Changes originating in another document get a fresh change ID, since
  868.                         // OpenDoc is not concerned with cycles across documents.
  869.                         // Note that the source document does not mark the edition file with a change ID
  870.                         // (one could be kept in the draft properties, I suppose).
  871.                         ODUpdateID updateID = somSelf->GetStorageUnit(ev)->GetSession(ev)->UniqueUpdateID(ev);
  872.                         somSelf->Clear(ev, updateID, key);
  873.                         ODStorageUnit* contentSU = somSelf->GetContentStorageUnit(ev, key);
  874.  
  875.                         // Existing properties inhibit cloning in the same property, so remove all properties
  876.                         // from the content storage unit before cloning.
  877.                         contentSU->Focus(ev, (ODPropertyName) kODNULL, kODPosAll, kODTypeAll, 0, kODPosUndefined);
  878.                         ODULong numProperties = contentSU->CountProperties(ev);
  879.                         ODULong i;
  880.                         for (i = 1; i <= numProperties; i++) {
  881.                                 contentSU->Focus(ev, (ODPropertyName) kODNULL, kODPosNextSib, kODTypeAll, 0, kODPosUndefined);
  882.                                 contentSU->Remove(ev);
  883.                                 }
  884.  
  885.                         somSelf->CloneFromMemoryContainer(ev, contentSU, dataHandle);
  886.  
  887.                         successful = kODTrue;
  888.  
  889.                         ODDisposeHandle(dataHandle);
  890.                 CATCH_ALL
  891.                         _fStatus = ErrorCode();
  892.                         ODDisposeHandle(dataHandle);
  893.                         WARN("Throw from ReadEditionFile");
  894.                 ENDTRY
  895.         }
  896.  
  897.         closeError = CloseEdition(edRefNum, successful);
  898.         if ( successful )
  899.                 somSelf->SetChangeTime(ev, (**_fSection).mdDate, key);
  900.  
  901.         THROW_IF_ERROR(readError);
  902.         #endif
  903. }
  904.  
  905. //------------------------------------------------------------------------------
  906. // ODLinkSource: SetStatus
  907. //------------------------------------------------------------------------------
  908.  
  909. SOM_Scope void  SOMLINK ODLinkSourceSetStatus(ODLinkSource *somSelf, Environment *ev,
  910.                 ODError error)
  911. {
  912.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  913.         ODLinkSourceMethodDebug("ODLinkSource","SetStatus");
  914.  
  915.         _fStatus = error;
  916. }
  917.  
  918. //------------------------------------------------------------------------------
  919. // ODLinkSource: GetStatus
  920. //------------------------------------------------------------------------------
  921.  
  922. SOM_Scope ODError  SOMLINK ODLinkSourceGetStatus(ODLinkSource *somSelf, Environment *ev)
  923. {
  924.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  925.         ODLinkSourceMethodDebug("ODLinkSource","GetStatus");
  926.  
  927.         return _fStatus;
  928. }
  929.  
  930. //------------------------------------------------------------------------------
  931. // ODLinkSource: CloneFromMemoryContainer
  932. //------------------------------------------------------------------------------
  933. // This method does not call it's draft's SetChangeFromPrev() method so that the
  934. // user is not prompted to save changes if the only change was to update a link
  935. // from an edition file.
  936.  
  937.  
  938. SOM_Scope void  SOMLINK ODLinkSourceCloneFromMemoryContainer(ODLinkSource *somSelf, Environment *ev,
  939.                 ODStorageUnit* contentSU,
  940.                 ODHandle containerHandle)
  941. {
  942.         ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  943.         ODLinkSourceMethodDebug("ODLinkSource","CloneFromMemoryContainer");
  944.  
  945. #ifdef _PLATFORM_OS2_
  946.         SOM_TRY
  947. #else
  948.         SOM_CATCH return;
  949. #endif
  950.  
  951.         ODStorageUnitID         rootID;
  952.         ODDraft*                        myDraft = contentSU->GetDraft(ev);
  953.         ODSession*                      session = somSelf->GetStorageUnit(ev)->GetSession(ev);
  954.  
  955.         TempODContainer container = GetMemoryContainer(ev, session, containerHandle, kODBentoMemoryContainer);
  956.  
  957.         TempODDocument document = container->AcquireDocument(ev, kODDefaultDocument);
  958.  
  959.         TempODDraft draft = document->AcquireBaseDraft(ev, kODDPExclusiveWrite);
  960.  
  961.         { TempODStorageUnit draftProperties = draft->AcquireDraftProperties(ev);
  962.           rootID = ODGetStrongSURefProp(ev, draftProperties, kODPropRootPartSU, kODStrongStorageUnitRef);
  963.         }
  964.  
  965.         TempODStorageUnit rootSU = draft->AcquireStorageUnit(ev, rootID);
  966.  
  967.         ODDraftKey draftKey = draft->BeginClone(ev, myDraft, kODNULL, kODCloneAll);
  968.         TRY
  969.                 draft->Clone(ev, draftKey, rootID, contentSU->GetID(ev), 0);
  970.  
  971.                 if ( ODSUExistsThenFocus(ev, rootSU, kODPropContentFrame, kODWeakStorageUnitRef) )
  972.                 {
  973.                         ODID contentFrameID = ODGetWeakSURefProp(ev, rootSU, kODPropContentFrame, kODWeakStorageUnitRef);
  974.                         draft->Clone(ev, draftKey, contentFrameID, kODNULLID, 0);
  975.                 }
  976.         CATCH_ALL
  977.                 draft->AbortClone(ev, draftKey);
  978.                 RERAISE;
  979.         ENDTRY
  980.         draft->EndClone(ev, draftKey);
  981.  
  982.         #ifdef _PLATFORM_OS2_
  983.         SOM_CATCH_ALL
  984.         SOM_ENDTRY
  985.         return;
  986.         #endif
  987. }
  988.  
  989.  
  990. #ifdef _PLATFORM_OS2_
  991. //------------------------------------------------------------------------------
  992. // ODLinkSource: GetLinkConnectionData
  993. //------------------------------------------------------------------------------
  994.  
  995. SOM_Scope void  SOMLINK ODLinkSourceGetLinkConnectionData(ODLinkSource *somSelf,
  996.                                                            Environment *ev,
  997.                                                           ODLinkConnectionID connID,
  998.                                                           ODLinkConnectionData** ConnData)
  999. {
  1000.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1001.    ODLinkSourceMethodDebug("ODLinkSource","DescribeLinkTarget");
  1002.    somSelf->SubClassResponsibility(ev);
  1003. }
  1004.  
  1005. //------------------------------------------------------------------------------
  1006. // ODLinkSource: GetConnectionData
  1007. //------------------------------------------------------------------------------
  1008. SOM_Scope void  SOMLINK ODLinkSourceGetConnectionData(ODLinkSource *somSelf, Environment *ev,
  1009.                 ODLinkConnectionData** srcConnData)
  1010. {
  1011.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1012.    ODLinkSourceMethodDebug("ODLinkSource","DescribeSelf");
  1013.    somSelf->SubClassResponsibility(ev);
  1014. }
  1015.  
  1016. //------------------------------------------------------------------------------
  1017. // ODLinkSource: GetLinkConnections
  1018. //------------------------------------------------------------------------------
  1019. SOM_Scope void  SOMLINK ODLinkSourceGetLinkConnections(ODLinkSource *somSelf,
  1020.                                                         Environment *ev,
  1021.                                                        _IDL_SEQUENCE_unsigned_long* connIDs)
  1022. {
  1023.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1024.    ODLinkSourceMethodDebug("ODLinkSource","GetLinkTargets");
  1025.    somSelf->SubClassResponsibility(ev);
  1026. }
  1027.  
  1028. //------------------------------------------------------------------------------
  1029. // ODLinkSource: InitCallBackMode
  1030. //------------------------------------------------------------------------------
  1031. /*
  1032.  * Called by Part after creation to initialize the mode of tracking
  1033.  *   LinkTargets.
  1034.  * By default LinkSource only tracks local or registered LinkTargets.
  1035.  *void RemoveLinkTarget (in IODConnectionID trgtID);
  1036.  */
  1037.  
  1038. SOM_Scope void  SOMLINK ODLinkSourceInitCallBackMode(ODLinkSource *somSelf, Environment *ev,
  1039.                 ODBoolean trackTrgt)
  1040. {
  1041.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1042.    ODLinkSourceMethodDebug("ODLinkSource","InitCallBackMode");
  1043.    somSelf->SubClassResponsibility(ev);
  1044. }
  1045.  
  1046. //------------------------------------------------------------------------------
  1047. // ODLinkSource: BreakLinkConnection
  1048. //------------------------------------------------------------------------------
  1049. SOM_Scope void  SOMLINK ODLinkSourceBreakLinkConnection(ODLinkSource *somSelf,
  1050.                                                          Environment *ev,
  1051.                                                         ODLinkConnectionID connID)
  1052. {
  1053.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1054.    ODLinkSourceMethodDebug("ODLinkSource","RemoveLinkTarget");
  1055.    somSelf->SubClassResponsibility(ev);
  1056. }
  1057.  
  1058. //------------------------------------------------------------------------------
  1059. // ODLinkSource: SetDescription
  1060. //------------------------------------------------------------------------------
  1061. SOM_Scope void  SOMLINK ODLinkSourceSetDescription(ODLinkSource *somSelf,
  1062.                                                     Environment *ev,
  1063.                                                    ODLinkDescription* desc)
  1064. {
  1065.    ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf);
  1066.    ODLinkSourceMethodDebug("ODLinkSource","SetDescripton");
  1067.    somSelf->SubClassResponsibility(ev);
  1068. }
  1069.  
  1070. /*
  1071.  * Called by source Part to get its commentary.
  1072.  */
  1073.  
  1074. SOM_Scope void  SOMLINK ODLinkSourceGetDescription(ODLinkSource *somSelf,
  1075.                                                     Environment *ev,
  1076.                                                    ODLinkDescription* desc)
  1077. {
  1078.     /* ODLinkSourceData *somThis = ODLinkSourceGetData(somSelf); */
  1079.     ODLinkSourceMethodDebug("ODLinkSource","ODLinkSourceGetDescription");
  1080.  
  1081. }
  1082.  
  1083. #endif /*_PLATFORM_OS2_*/
  1084.  
  1085.